chromium/third_party/dawn/src/tint/lang/wgsl/intrinsic/table_test.cc

// Copyright 2024 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/intrinsic/table.h"

#include <utility>

#include "gmock/gmock.h"
#include "src/tint/lang/core/intrinsic/table_data.h"
#include "src/tint/lang/core/type/atomic.h"
#include "src/tint/lang/core/type/depth_multisampled_texture.h"
#include "src/tint/lang/core/type/depth_texture.h"
#include "src/tint/lang/core/type/external_texture.h"
#include "src/tint/lang/core/type/helper_test.h"
#include "src/tint/lang/core/type/multisampled_texture.h"
#include "src/tint/lang/core/type/reference.h"
#include "src/tint/lang/core/type/sampled_texture.h"
#include "src/tint/lang/core/type/storage_texture.h"
#include "src/tint/lang/core/type/texture_dimension.h"
#include "src/tint/lang/wgsl/intrinsic/dialect.h"
#include "src/tint/lang/wgsl/resolver/resolver_helper_test.h"

namespace tint::wgsl::intrinsic {
namespace {

HasSubstr;
usingnamespacetint::core::fluent_types;  // NOLINT

ParameterUsage;
OverloadFlag;

AFloatV;
AIntV;
f32V;
i32V;
u32V;

class WgslIntrinsicTableTest : public testing::Test, public ProgramBuilder {};

TEST_F(WgslIntrinsicTableTest, MatchF32) {}

TEST_F(WgslIntrinsicTableTest, MismatchF32) {}

TEST_F(WgslIntrinsicTableTest, MatchU32) {}

TEST_F(WgslIntrinsicTableTest, MismatchU32) {}

TEST_F(WgslIntrinsicTableTest, MatchI32) {}

TEST_F(WgslIntrinsicTableTest, MismatchI32) {}

TEST_F(WgslIntrinsicTableTest, MatchIU32AsI32) {}

TEST_F(WgslIntrinsicTableTest, MatchIU32AsU32) {}

TEST_F(WgslIntrinsicTableTest, MismatchIU32) {}

TEST_F(WgslIntrinsicTableTest, MatchFIU32AsI32) {}

TEST_F(WgslIntrinsicTableTest, MatchFIU32AsU32) {}

TEST_F(WgslIntrinsicTableTest, MatchFIU32AsF32) {}

TEST_F(WgslIntrinsicTableTest, MismatchFIU32) {}

TEST_F(WgslIntrinsicTableTest, MatchBool) {}

TEST_F(WgslIntrinsicTableTest, MismatchBool) {}

TEST_F(WgslIntrinsicTableTest, MatchPointer) {}

TEST_F(WgslIntrinsicTableTest, MismatchPointer) {}

TEST_F(WgslIntrinsicTableTest, MatchArray) {}

TEST_F(WgslIntrinsicTableTest, MismatchArray) {}

TEST_F(WgslIntrinsicTableTest, MatchSampler) {}

TEST_F(WgslIntrinsicTableTest, MismatchSampler) {}

TEST_F(WgslIntrinsicTableTest, MatchSampledTexture) {}

TEST_F(WgslIntrinsicTableTest, MatchMultisampledTexture) {}

TEST_F(WgslIntrinsicTableTest, MatchDepthTexture) {}

TEST_F(WgslIntrinsicTableTest, MatchDepthMultisampledTexture) {}

TEST_F(WgslIntrinsicTableTest, MatchExternalTexture) {}

TEST_F(WgslIntrinsicTableTest, MatchWOStorageTexture) {}

TEST_F(WgslIntrinsicTableTest, MismatchTexture) {}

TEST_F(WgslIntrinsicTableTest, MatchTemplateType) {}

TEST_F(WgslIntrinsicTableTest, MismatchTemplateType) {}

TEST_F(WgslIntrinsicTableTest, MatchOpenSizeVector) {}

TEST_F(WgslIntrinsicTableTest, MismatchOpenSizeVector) {}

TEST_F(WgslIntrinsicTableTest, MatchOpenSizeMatrix) {}

TEST_F(WgslIntrinsicTableTest, MismatchOpenSizeMatrix) {}

TEST_F(WgslIntrinsicTableTest, MatchDifferentArgsElementType_Builtin_ConstantEval) {}

TEST_F(WgslIntrinsicTableTest, MatchDifferentArgsElementType_Builtin_RuntimeEval) {}

TEST_F(WgslIntrinsicTableTest, MatchDifferentArgsElementType_Binary_ConstantEval) {}

TEST_F(WgslIntrinsicTableTest, MatchDifferentArgsElementType_Binary_RuntimeEval) {}

TEST_F(WgslIntrinsicTableTest, OverloadOrderByNumberOfParameters) {}

TEST_F(WgslIntrinsicTableTest, OverloadOrderByMatchingParameter) {}

TEST_F(WgslIntrinsicTableTest, MatchUnaryOp) {}

TEST_F(WgslIntrinsicTableTest, MismatchUnaryOp) {}

TEST_F(WgslIntrinsicTableTest, MatchUnaryOp_Constant) {}

TEST_F(WgslIntrinsicTableTest, MatchUnaryOp_Runtime) {}

TEST_F(WgslIntrinsicTableTest, MatchBinaryOp) {}

TEST_F(WgslIntrinsicTableTest, MismatchBinaryOp) {}

TEST_F(WgslIntrinsicTableTest, MatchCompoundOp) {}

TEST_F(WgslIntrinsicTableTest, MismatchCompoundOp) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeInitializerImplicit) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeInitializerExplicit) {}

TEST_F(WgslIntrinsicTableTest, MismatchTypeInitializerImplicit) {}

TEST_F(WgslIntrinsicTableTest, MismatchTypeInitializerExplicit) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeInitializerImplicitVecFromVecAbstract) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeInitializerImplicitMatFromVec) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeInitializer_ConstantEval) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeInitializer_RuntimeEval) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeConversion) {}

TEST_F(WgslIntrinsicTableTest, MismatchTypeConversion) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeConversion_ConstantEval) {}

TEST_F(WgslIntrinsicTableTest, MatchTypeConversion_RuntimeEval) {}

TEST_F(WgslIntrinsicTableTest, Err257Arguments) {}

TEST_F(WgslIntrinsicTableTest, OverloadResolution) {}

////////////////////////////////////////////////////////////////////////////////
// AbstractBinaryTests
////////////////////////////////////////////////////////////////////////////////
namespace AbstractBinaryTests {
struct Case {};

struct IntrinsicTableAbstractBinaryTest : public resolver::ResolverTestWithParam<Case> {};

TEST_P(IntrinsicTableAbstractBinaryTest, MatchAdd) {}

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

INSTANTIATE_TEST_SUITE_P();  // clang-format on

}  // namespace AbstractBinaryTests

////////////////////////////////////////////////////////////////////////////////
// AbstractTernaryTests
////////////////////////////////////////////////////////////////////////////////
namespace AbstractTernaryTests {
struct Case {};

struct IntrinsicTableAbstractTernaryTest : public resolver::ResolverTestWithParam<Case> {};

TEST_P(IntrinsicTableAbstractTernaryTest, MatchClamp) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();

}  // namespace AbstractTernaryTests

}  // namespace
}  // namespace tint::wgsl::intrinsic