chromium/third_party/dawn/src/tint/lang/msl/writer/raise/builtin_polyfill_test.cc

// Copyright 2023 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/msl/writer/raise/builtin_polyfill.h"

#include <utility>

#include "gtest/gtest.h"
#include "src/tint/lang/core/access.h"
#include "src/tint/lang/core/fluent_types.h"
#include "src/tint/lang/core/ir/transform/helper_test.h"
#include "src/tint/lang/core/number.h"
#include "src/tint/lang/core/texel_format.h"
#include "src/tint/lang/core/type/atomic.h"
#include "src/tint/lang/core/type/builtin_structs.h"
#include "src/tint/lang/core/type/depth_texture.h"
#include "src/tint/lang/core/type/multisampled_texture.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"

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

namespace tint::msl::writer::raise {
namespace {

MslWriter_BuiltinPolyfillTest;

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicAdd_Workgroup_I32) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicAdd_Storage_U32) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicAnd) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicExchange) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicLoad) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicMax) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicMin) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicOr) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicStore) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicSub) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicXor) {}

TEST_F(MslWriter_BuiltinPolyfillTest, AtomicCompareExchangeWeak) {}

TEST_F(MslWriter_BuiltinPolyfillTest,
       AtomicCompareExchangeWeak_Multiple_SameAddressSpace_SameType) {}

TEST_F(MslWriter_BuiltinPolyfillTest,
       AtomicCompareExchangeWeak_Multiple_SameAddressSpace_DifferentType) {}

TEST_F(MslWriter_BuiltinPolyfillTest,
       AtomicCompareExchangeWeak_Multiple_DifferentAddressSpace_SameType) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Distance_Scalar) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Distance_Vector) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot_I32) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot_U32) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot_F32) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot_MultipleCalls) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot4I8Packed) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot4U8Packed) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Dot4x8Packed_MultipleCalls) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Frexp_Scalar) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Frexp_Vector) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Length_Scalar) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Length_Vector) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Modf_Scalar) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Modf_Vector) {}

TEST_F(MslWriter_BuiltinPolyfillTest, QuantizeToF16_Scalar) {}

TEST_F(MslWriter_BuiltinPolyfillTest, QuantizeToF16_Vector) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Sign_F32) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Sign_Scalar) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Sign_Vector) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureDimensions_1d) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureDimensions_2d_WithoutLod) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureDimensions_2d_WithI32Lod) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureDimensions_3d) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureGather_2d_UnsignedComponent) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureGather_2d_SignedComponent) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureGather_2d_WithOffset) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureGather_Depth2d) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureGatherCompare) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_1d_U32Coord) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_1d_I32Coord) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_2d_U32Coords) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_2d_I32Coords) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_2d_WithLevel) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_2darray_U32Index) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_2darray_I32Index) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_2darray_WithLevel) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureLoad_3d) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureNumLayers) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureNumLevels) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureNumSamples) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSample) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleBias) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleBias_Array) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleCompare) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleCompareLevel_WithOffset) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleGrad_2d) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureGather_2dArray) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleGrad_2dArray) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleGrad_3d) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleGrad_Cube) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleGrad_WithOffset) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleLevel) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureSampleLevel_Array) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_1d_U32Coord) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_1d_I32Coord) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2d_U32Coords) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2d_I32Coords) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2darray_U32Index) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_2darray_I32Index) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureStore_3d) {}

// Test that we insert a fence after the store to ensure that it is ordered before the load.
TEST_F(MslWriter_BuiltinPolyfillTest, TextureStoreToReadWriteBeforeLoad) {}

TEST_F(MslWriter_BuiltinPolyfillTest, WorkgroupBarrier) {}

TEST_F(MslWriter_BuiltinPolyfillTest, StorageBarrier) {}

TEST_F(MslWriter_BuiltinPolyfillTest, TextureBarrier) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Pack2x16Float) {}

TEST_F(MslWriter_BuiltinPolyfillTest, Unpack2x16Float) {}

}  // namespace
}  // namespace tint::msl::writer::raise