#include "src/tint/lang/core/builtin_value.h"
#include "src/tint/lang/wgsl/ast/builtin_attribute.h"
#include "src/tint/lang/wgsl/ast/location_attribute.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 "gmock/gmock.h"
namespace tint::resolver {
namespace {
usingnamespacetint::core::fluent_types;
usingnamespacetint::core::number_suffixes;
DataType;
alias;
class ResolverEntryPointValidationTest : public TestHelper, public testing::Test { … };
TEST_F(ResolverEntryPointValidationTest, ReturnTypeAttribute_Location) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnTypeAttribute_Builtin) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnTypeAttribute_Missing) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnTypeAttribute_Multiple) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnType_Struct_Valid) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnType_Struct_MemberMultipleAttributes) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnType_Struct_MemberMissingAttribute) { … }
TEST_F(ResolverEntryPointValidationTest, ReturnType_Struct_DuplicateBuiltins) { … }
TEST_F(ResolverEntryPointValidationTest, ParameterAttribute_Location) { … }
TEST_F(ResolverEntryPointValidationTest, ParameterAttribute_Missing) { … }
TEST_F(ResolverEntryPointValidationTest, ParameterAttribute_Multiple) { … }
TEST_F(ResolverEntryPointValidationTest, Parameter_Struct_Valid) { … }
TEST_F(ResolverEntryPointValidationTest, Parameter_Struct_MemberMultipleAttributes) { … }
TEST_F(ResolverEntryPointValidationTest, Parameter_Struct_MemberMissingAttribute) { … }
TEST_F(ResolverEntryPointValidationTest, Parameter_DuplicateBuiltins) { … }
TEST_F(ResolverEntryPointValidationTest, Parameter_Struct_DuplicateBuiltins) { … }
TEST_F(ResolverEntryPointValidationTest, VertexShaderMustReturnPosition) { … }
TEST_F(ResolverEntryPointValidationTest, PushConstantAllowedWithEnable) { … }
TEST_F(ResolverEntryPointValidationTest, PushConstantDisallowedWithoutEnable) { … }
TEST_F(ResolverEntryPointValidationTest, PushConstantAllowedWithIgnoreAddressSpaceAttribute) { … }
TEST_F(ResolverEntryPointValidationTest, PushConstantOneVariableUsedInEntryPoint) { … }
TEST_F(ResolverEntryPointValidationTest, PushConstantTwoVariablesUsedInEntryPoint) { … }
TEST_F(ResolverEntryPointValidationTest,
PushConstantTwoVariablesUsedInEntryPointWithFunctionGraph) { … }
TEST_F(ResolverEntryPointValidationTest, PushConstantTwoVariablesUsedInDifferentEntryPoint) { … }
namespace TypeValidationTests {
struct Params { … };
template <typename T>
constexpr Params ParamsFor(bool is_valid) { … }
TypeValidationTest;
static constexpr Params cases[] = …;
TEST_P(TypeValidationTest, BareInputs) { … }
TEST_P(TypeValidationTest, StructInputs) { … }
TEST_P(TypeValidationTest, BareOutputs) { … }
TEST_P(TypeValidationTest, StructOutputs) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
namespace LocationAttributeTests {
namespace {
LocationAttributeTests;
TEST_F(LocationAttributeTests, Pass) { … }
TEST_F(LocationAttributeTests, BadType_Input_bool) { … }
TEST_F(LocationAttributeTests, BadType_Output_Array) { … }
TEST_F(LocationAttributeTests, BadType_Input_Struct) { … }
TEST_F(LocationAttributeTests, BadType_Input_Struct_NestedStruct) { … }
TEST_F(LocationAttributeTests, BadType_Input_Struct_RuntimeArray) { … }
TEST_F(LocationAttributeTests, BadMemberType_Input) { … }
TEST_F(LocationAttributeTests, BadMemberType_Output) { … }
TEST_F(LocationAttributeTests, BadMemberType_Unused) { … }
TEST_F(LocationAttributeTests, ReturnType_Struct_Valid) { … }
TEST_F(LocationAttributeTests, ReturnType_Struct) { … }
TEST_F(LocationAttributeTests, ReturnType_Struct_NestedStruct) { … }
TEST_F(LocationAttributeTests, ReturnType_Struct_RuntimeArray) { … }
TEST_F(LocationAttributeTests, ComputeShaderLocation_Input) { … }
TEST_F(LocationAttributeTests, ComputeShaderLocation_Output) { … }
TEST_F(LocationAttributeTests, ComputeShaderLocationStructMember_Output) { … }
TEST_F(LocationAttributeTests, ComputeShaderLocationStructMember_Input) { … }
TEST_F(LocationAttributeTests, Duplicate_input) { … }
TEST_F(LocationAttributeTests, Duplicate_struct) { … }
}
}
}
}