chromium/third_party/dawn/src/tint/lang/wgsl/resolver/entry_point_validation_test.cc

// Copyright 2021 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#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;     // NOLINT
usingnamespacetint::core::number_suffixes;  // NOLINT

// Helpers and typedefs
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 TypeValidationTests

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) {}

}  // namespace
}  // namespace LocationAttributeTests

}  // namespace
}  // namespace tint::resolver