chromium/third_party/dawn/src/tint/lang/wgsl/resolver/variable_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 "gmock/gmock.h"
#include "src/tint/lang/core/type/texture_dimension.h"
#include "src/tint/lang/wgsl/resolver/resolver.h"
#include "src/tint/lang/wgsl/resolver/resolver_helper_test.h"

namespace tint::resolver {
namespace {

usingnamespacetint::core::fluent_types;     // NOLINT
usingnamespacetint::core::number_suffixes;  // NOLINT

struct ResolverVariableValidationTest : public resolver::TestHelper, public testing::Test {};

TEST_F(ResolverVariableValidationTest, VarNoInitializerNoType) {}

TEST_F(ResolverVariableValidationTest, GlobalVarNoInitializerNoType) {}

TEST_F(ResolverVariableValidationTest, VarInitializerNoReturnValueBuiltin) {}

TEST_F(ResolverVariableValidationTest, GlobalVarInitializerNoReturnValueBuiltin) {}

TEST_F(ResolverVariableValidationTest, GlobalVarNoAddressSpace) {}

TEST_F(ResolverVariableValidationTest, GlobalVarWithInitializerNoAddressSpace) {}

TEST_F(ResolverVariableValidationTest, GlobalVarUsedAtModuleScope) {}

TEST_F(ResolverVariableValidationTest, OverrideNoInitializerNoType) {}

TEST_F(ResolverVariableValidationTest, OverrideExceedsIDLimit_LastUnreserved) {}

TEST_F(ResolverVariableValidationTest, OverrideExceedsIDLimit_LastReserved) {}

TEST_F(ResolverVariableValidationTest, VarTypeNotConstructible) {}

TEST_F(ResolverVariableValidationTest, LetTypeNotConstructible) {}

TEST_F(ResolverVariableValidationTest, OverrideExplicitTypeNotScalar) {}

TEST_F(ResolverVariableValidationTest, OverrideInferedTypeNotScalar) {}

TEST_F(ResolverVariableValidationTest, ConstInitializerWrongType) {}

TEST_F(ResolverVariableValidationTest, LetInitializerWrongType) {}

TEST_F(ResolverVariableValidationTest, VarInitializerWrongType) {}

TEST_F(ResolverVariableValidationTest, ConstInitializerWrongTypeViaAlias) {}

TEST_F(ResolverVariableValidationTest, LetInitializerWrongTypeViaAlias) {}

TEST_F(ResolverVariableValidationTest, VarInitializerWrongTypeViaAlias) {}

TEST_F(ResolverVariableValidationTest, LetOfPtrConstructedWithRef) {}

TEST_F(ResolverVariableValidationTest, LocalLetRedeclared) {}

TEST_F(ResolverVariableValidationTest, GlobalVarRedeclaredAsLocal) {}

TEST_F(ResolverVariableValidationTest, VarRedeclaredInInnerBlock) {}

TEST_F(ResolverVariableValidationTest, VarRedeclaredInIfBlock) {}

TEST_F(ResolverVariableValidationTest, InferredPtrStorageAccessMismatch) {}

TEST_F(ResolverVariableValidationTest, NonConstructibleType_Atomic) {}

TEST_F(ResolverVariableValidationTest, NonConstructibleType_RuntimeArray) {}

TEST_F(ResolverVariableValidationTest, NonConstructibleType_Struct_WithAtomic) {}

TEST_F(ResolverVariableValidationTest, NonConstructibleType_InferredType) {}

TEST_F(ResolverVariableValidationTest, InvalidAddressSpaceForInitializer) {}

TEST_F(ResolverVariableValidationTest, VectorConstNoType) {}

TEST_F(ResolverVariableValidationTest, VectorLetNoType) {}

TEST_F(ResolverVariableValidationTest, VectorVarNoType) {}

TEST_F(ResolverVariableValidationTest, MatrixConstNoType) {}

TEST_F(ResolverVariableValidationTest, MatrixLetNoType) {}

TEST_F(ResolverVariableValidationTest, MatrixVarNoType) {}

TEST_F(ResolverVariableValidationTest, GlobalConstWithRuntimeExpression) {}

TEST_F(ResolverVariableValidationTest, ConstInitWithVar) {}

TEST_F(ResolverVariableValidationTest, ConstInitWithOverride) {}

TEST_F(ResolverVariableValidationTest, ConstInitWithLet) {}

TEST_F(ResolverVariableValidationTest, ConstInitWithRuntimeExpr) {}

TEST_F(ResolverVariableValidationTest, ConstInitWithOverrideExpr) {}

TEST_F(ResolverVariableValidationTest, GlobalVariable_PushConstantWithInitializer) {}

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