chromium/third_party/dawn/src/tint/lang/core/ir/binary/roundtrip_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/core/ir/ir_helper_test.h"

#include "src/tint/lang/core/io_attributes.h"
#include "src/tint/lang/core/ir/binary/decode.h"
#include "src/tint/lang/core/ir/binary/encode.h"
#include "src/tint/lang/core/ir/disassembler.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/input_attachment.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"

namespace tint::core::ir::binary {
namespace {

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

template <typename T = testing::Test>
class IRBinaryRoundtripTestBase : public IRTestParamHelper<T> {};

#define RUN_TEST()

IRBinaryRoundtripTest;
TEST_F(IRBinaryRoundtripTest, EmptyModule) {}

////////////////////////////////////////////////////////////////////////////////
// Root block
////////////////////////////////////////////////////////////////////////////////
TEST_F(IRBinaryRoundtripTest, RootBlock_Var_private_i32_Unnamed) {}

TEST_F(IRBinaryRoundtripTest, RootBlock_Var_workgroup_f32_Named) {}

TEST_F(IRBinaryRoundtripTest, RootBlock_Var_storage_binding) {}

////////////////////////////////////////////////////////////////////////////////
// Functions
////////////////////////////////////////////////////////////////////////////////
TEST_F(IRBinaryRoundtripTest, Fn_i32_ret) {}

IRBinaryRoundtripTest_FnPipelineStage;
TEST_P(IRBinaryRoundtripTest_FnPipelineStage, Test) {}
INSTANTIATE_TEST_SUITE_P();

TEST_F(IRBinaryRoundtripTest, Fn_WorkgroupSize) {}

TEST_F(IRBinaryRoundtripTest, Fn_Parameters) {}

TEST_F(IRBinaryRoundtripTest, Fn_ParameterAttributes) {}

TEST_F(IRBinaryRoundtripTest, Fn_ReturnBuiltin) {}

TEST_F(IRBinaryRoundtripTest, Fn_ReturnLocation) {}

TEST_F(IRBinaryRoundtripTest, Fn_ReturnLocation_Interpolation) {}

TEST_F(IRBinaryRoundtripTest, Fn_ReturnInvariant) {}

////////////////////////////////////////////////////////////////////////////////
// Types
////////////////////////////////////////////////////////////////////////////////
TEST_F(IRBinaryRoundtripTest, bool) {}

TEST_F(IRBinaryRoundtripTest, i32) {}

TEST_F(IRBinaryRoundtripTest, u32) {}

TEST_F(IRBinaryRoundtripTest, f32) {}

TEST_F(IRBinaryRoundtripTest, f16) {}

TEST_F(IRBinaryRoundtripTest, vec2_f32) {}

TEST_F(IRBinaryRoundtripTest, vec3_i32) {}

TEST_F(IRBinaryRoundtripTest, vec4_bool) {}

TEST_F(IRBinaryRoundtripTest, mat4x2_f32) {}

TEST_F(IRBinaryRoundtripTest, mat2x4_f16) {}

TEST_F(IRBinaryRoundtripTest, ptr_function_f32_read_write) {}

TEST_F(IRBinaryRoundtripTest, ptr_workgroup_i32_read) {}

TEST_F(IRBinaryRoundtripTest, array_i32_4) {}

TEST_F(IRBinaryRoundtripTest, array_i32_runtime_sized) {}

TEST_F(IRBinaryRoundtripTest, struct) {}

TEST_F(IRBinaryRoundtripTest, IOAttributes) {}

TEST_F(IRBinaryRoundtripTest, atomic_i32) {}

TEST_F(IRBinaryRoundtripTest, depth_texture) {}

TEST_F(IRBinaryRoundtripTest, sampled_texture) {}

TEST_F(IRBinaryRoundtripTest, multisampled_texture) {}

TEST_F(IRBinaryRoundtripTest, depth_multisampled_texture) {}

TEST_F(IRBinaryRoundtripTest, storage_texture) {}

TEST_F(IRBinaryRoundtripTest, external_texture) {}

TEST_F(IRBinaryRoundtripTest, sampler) {}

TEST_F(IRBinaryRoundtripTest, comparision_sampler) {}

////////////////////////////////////////////////////////////////////////////////
// Instructions
////////////////////////////////////////////////////////////////////////////////
TEST_F(IRBinaryRoundtripTest, Return) {}

TEST_F(IRBinaryRoundtripTest, Return_bool) {}

TEST_F(IRBinaryRoundtripTest, Return_i32) {}

TEST_F(IRBinaryRoundtripTest, Return_u32) {}

TEST_F(IRBinaryRoundtripTest, Return_f32) {}

TEST_F(IRBinaryRoundtripTest, Return_f16) {}

TEST_F(IRBinaryRoundtripTest, Return_vec3f_Composite) {}

TEST_F(IRBinaryRoundtripTest, Return_vec3f_Splat) {}

TEST_F(IRBinaryRoundtripTest, Return_mat2x3f_Composite) {}

TEST_F(IRBinaryRoundtripTest, Return_mat2x3f_Splat) {}

TEST_F(IRBinaryRoundtripTest, Return_array_f32_Composite) {}

TEST_F(IRBinaryRoundtripTest, Return_array_f32_Splat) {}

TEST_F(IRBinaryRoundtripTest, Construct) {}

TEST_F(IRBinaryRoundtripTest, Discard) {}

TEST_F(IRBinaryRoundtripTest, Let) {}

TEST_F(IRBinaryRoundtripTest, Var) {}

TEST_F(IRBinaryRoundtripTest, Access) {}

TEST_F(IRBinaryRoundtripTest, UserCall) {}

TEST_F(IRBinaryRoundtripTest, BuiltinCall) {}

TEST_F(IRBinaryRoundtripTest, Load) {}

TEST_F(IRBinaryRoundtripTest, Store) {}

TEST_F(IRBinaryRoundtripTest, LoadVectorElement) {}

TEST_F(IRBinaryRoundtripTest, StoreVectorElement) {}

TEST_F(IRBinaryRoundtripTest, UnaryOp) {}

TEST_F(IRBinaryRoundtripTest, BinaryOp) {}

TEST_F(IRBinaryRoundtripTest, Swizzle) {}

TEST_F(IRBinaryRoundtripTest, Bitcast) {}

TEST_F(IRBinaryRoundtripTest, Convert) {}

TEST_F(IRBinaryRoundtripTest, IfTrue) {}

TEST_F(IRBinaryRoundtripTest, IfFalse) {}

TEST_F(IRBinaryRoundtripTest, IfTrueFalse) {}

TEST_F(IRBinaryRoundtripTest, IfResults) {}

TEST_F(IRBinaryRoundtripTest, Switch) {}

TEST_F(IRBinaryRoundtripTest, SwitchResults) {}

TEST_F(IRBinaryRoundtripTest, LoopBody) {}

TEST_F(IRBinaryRoundtripTest, LoopInitBody) {}

TEST_F(IRBinaryRoundtripTest, LoopInitBodyCont) {}

TEST_F(IRBinaryRoundtripTest, LoopResults) {}

TEST_F(IRBinaryRoundtripTest, LoopBlockParams) {}

TEST_F(IRBinaryRoundtripTest, Unreachable) {}

TEST_F(IRBinaryRoundtripTest, InputAttachment) {}

}  // namespace
}  // namespace tint::core::ir::binary