#include "src/tint/lang/core/builtin_value.h"
#include "src/tint/lang/wgsl/ast/discard_statement.h"
#include "src/tint/lang/wgsl/ast/return_statement.h"
#include "src/tint/lang/wgsl/ast/stage_attribute.h"
#include "src/tint/lang/wgsl/resolver/resolver.h"
#include "src/tint/lang/wgsl/resolver/resolver_helper_test.h"
#include "src/tint/utils/text/string_stream.h"
#include "gmock/gmock.h"
namespace tint::resolver {
namespace {
usingnamespacetint::core::fluent_types;
usingnamespacetint::core::number_suffixes;
class ResolverFunctionValidationTest : public TestHelper, public testing::Test { … };
TEST_F(ResolverFunctionValidationTest, DuplicateParameterName) { … }
TEST_F(ResolverFunctionValidationTest, ParameterMayShadowGlobal) { … }
TEST_F(ResolverFunctionValidationTest, LocalConflictsWithParameter) { … }
TEST_F(ResolverFunctionValidationTest, NestedLocalMayShadowParameter) { … }
TEST_F(ResolverFunctionValidationTest, VoidFunctionEndWithoutReturnStatement_Pass) { … }
TEST_F(ResolverFunctionValidationTest, FunctionUsingSameVariableName_Pass) { … }
TEST_F(ResolverFunctionValidationTest, FunctionNameSameAsFunctionScopeVariableName_Pass) { … }
TEST_F(ResolverFunctionValidationTest, UnreachableCode_return) { … }
TEST_F(ResolverFunctionValidationTest, UnreachableCode_return_InBlocks) { … }
TEST_F(ResolverFunctionValidationTest, UnreachableCode_discard_nowarning) { … }
TEST_F(ResolverFunctionValidationTest, DiscardCalledDirectlyFromVertexEntryPoint) { … }
TEST_F(ResolverFunctionValidationTest, DiscardCalledIndirectlyFromComputeEntryPoint) { … }
TEST_F(ResolverFunctionValidationTest, FunctionEndWithoutReturnStatement_Fail) { … }
TEST_F(ResolverFunctionValidationTest, VoidFunctionEndWithoutReturnStatementEmptyBody_Pass) { … }
TEST_F(ResolverFunctionValidationTest, FunctionEndWithoutReturnStatementEmptyBody_Fail) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementType_Pass) { … }
TEST_F(ResolverFunctionValidationTest, VoidFunctionReturnsAInt) { … }
TEST_F(ResolverFunctionValidationTest, VoidFunctionReturnsAFloat) { … }
TEST_F(ResolverFunctionValidationTest, VoidFunctionReturnsI32) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementType_void_fail) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementTypeMissing_fail) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementTypeF32_pass) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementTypeF32_fail) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementTypeF32Alias_pass) { … }
TEST_F(ResolverFunctionValidationTest, FunctionTypeMustMatchReturnStatementTypeF32Alias_fail) { … }
TEST_F(ResolverFunctionValidationTest, CannotCallEntryPoint) { … }
TEST_F(ResolverFunctionValidationTest, CannotCallFunctionAtModuleScope) { … }
TEST_F(ResolverFunctionValidationTest, PipelineStage_MustBeUnique_Fail) { … }
TEST_F(ResolverFunctionValidationTest, NoPipelineEntryPoints) { … }
TEST_F(ResolverFunctionValidationTest, FunctionVarInitWithParam) { … }
TEST_F(ResolverFunctionValidationTest, FunctionConstInitWithParam) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_GoodType_ConstU32) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Cast) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_GoodType_I32) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_GoodType_U32) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_GoodType_I32_AInt) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_GoodType_U32_AInt) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Expr) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_MismatchType_U32) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_MismatchType_I32) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Const_TypeMismatch) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Const_TypeMismatch2) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Mismatch_ConstU32) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Literal_BadType) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Literal_Negative) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Literal_Zero) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Const_BadType) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Const_Negative) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Const_Zero) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_Const_NestedZeroValueInitializer) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_OverflowsU32_0x10000_0x100_0x100) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_OverflowsU32_0x10000_0x10000) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_OverflowsU32_0x10000_C_0x10000) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_OverflowsU32_0x10000_C) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_OverflowsU32_0x10000_O_0x10000) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_NonConst) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_InvalidExpr_x) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_InvalidExpr_y) { … }
TEST_F(ResolverFunctionValidationTest, WorkgroupSize_InvalidExpr_z) { … }
TEST_F(ResolverFunctionValidationTest, ReturnIsConstructible_NonPlain) { … }
TEST_F(ResolverFunctionValidationTest, ReturnIsConstructible_AtomicInt) { … }
TEST_F(ResolverFunctionValidationTest, ReturnIsConstructible_ArrayOfAtomic) { … }
TEST_F(ResolverFunctionValidationTest, ReturnIsConstructible_StructOfAtomic) { … }
TEST_F(ResolverFunctionValidationTest, ReturnIsConstructible_RuntimeArray) { … }
TEST_F(ResolverFunctionValidationTest, ParameterStoreType_NonAtomicFree) { … }
TEST_F(ResolverFunctionValidationTest, ParameterStoreType_AtomicFree) { … }
TEST_F(ResolverFunctionValidationTest, ParametersAtLimit) { … }
TEST_F(ResolverFunctionValidationTest, ParametersOverLimit) { … }
TEST_F(ResolverFunctionValidationTest, ParameterVectorNoType) { … }
TEST_F(ResolverFunctionValidationTest, ParameterMatrixNoType) { … }
enum class Expectation { … };
struct TestParams { … };
struct TestWithParams : ResolverTestWithParam<TestParams> { … };
ResolverFunctionParameterValidationTest;
TEST_P(ResolverFunctionParameterValidationTest, AddressSpaceWithoutUnrestrictedPointerParameters) { … }
TEST_P(ResolverFunctionParameterValidationTest, AddressSpaceWithUnrestrictedPointerParameters) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}