chromium/third_party/dawn/src/tint/lang/wgsl/writer/raise/value_to_let_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/wgsl/writer/raise/value_to_let.h"

#include <utility>

#include "src/tint/lang/core/ir/transform/helper_test.h"

namespace tint::wgsl::writer::raise {
namespace {

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

WgslWriter_ValueToLetTest;

TEST_F(WgslWriter_ValueToLetTest, Empty) {}

////////////////////////////////////////////////////////////////////////////////
// Load / Store
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenStoreVar_ThenUseLoad) {}

////////////////////////////////////////////////////////////////////////////////
// Binary op
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, BinaryOpUnsequencedLHSThenUnsequencedRHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpSequencedLHSThenUnsequencedRHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpUnsequencedLHSThenSequencedRHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpSequencedLHSThenSequencedRHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpUnsequencedRHSThenUnsequencedLHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpUnsequencedRHSThenSequencedLHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpSequencedRHSThenUnsequencedLHS) {}

TEST_F(WgslWriter_ValueToLetTest, BinaryOpSequencedRHSThenSequencedLHS) {}

////////////////////////////////////////////////////////////////////////////////
// Call
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, CallSequencedXYZ) {}

TEST_F(WgslWriter_ValueToLetTest, CallSequencedYXZ) {}

TEST_F(WgslWriter_ValueToLetTest, CallSequencedXZY) {}

TEST_F(WgslWriter_ValueToLetTest, CallSequencedZXY) {}

TEST_F(WgslWriter_ValueToLetTest, CallSequencedYZX) {}

TEST_F(WgslWriter_ValueToLetTest, CallSequencedZYX) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenCallVoidFn_ThenUseLoad) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenCallUnusedi32Fn_ThenUseLoad) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenCalli32Fn_ThenUseLoadBeforeCall) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenCalli32Fn_ThenUseCallBeforeLoad) {}

////////////////////////////////////////////////////////////////////////////////
// Access
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfArrayOfArray_XYZ) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfArrayOfArray_YXZ) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfArrayOfArray_ZXY) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfArrayOfArray_ZYX) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfMat3x4f_XYZ) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfMat3x4f_YXZ) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfMat3x4f_ZXY) {}

TEST_F(WgslWriter_ValueToLetTest, Access_ArrayOfMat3x4f_ZYX) {}

////////////////////////////////////////////////////////////////////////////////
// If
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, UnsequencedOutsideIf) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedOutsideIf) {}

TEST_F(WgslWriter_ValueToLetTest, UnsequencedUsedByIfCondition) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedUsedByIfCondition) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenWriteToVarInIf_ThenUseLoad) {}

////////////////////////////////////////////////////////////////////////////////
// Switch
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, UnsequencedOutsideSwitch) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedOutsideSwitch) {}

TEST_F(WgslWriter_ValueToLetTest, UnsequencedUsedBySwitchCondition) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedUsedBySwitchCondition) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenWriteToVarInSwitch_ThenUseLoad) {}

////////////////////////////////////////////////////////////////////////////////
// Loop
////////////////////////////////////////////////////////////////////////////////
TEST_F(WgslWriter_ValueToLetTest, UnsequencedOutsideLoopInitializer) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedOutsideLoopInitializer) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenWriteToVarInLoopInitializer_ThenUseLoad) {}

TEST_F(WgslWriter_ValueToLetTest, UnsequencedOutsideLoopBody) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedOutsideLoopBody) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenWriteToVarInLoopBody_ThenUseLoad) {}

TEST_F(WgslWriter_ValueToLetTest, UnsequencedOutsideLoopContinuing) {}

TEST_F(WgslWriter_ValueToLetTest, SequencedOutsideLoopContinuing) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVar_ThenWriteToVarInLoopContinuing_ThenUseLoad) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVarInLoopInitializer_ThenReadAndWriteToVarInLoopBody) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVarInLoopInitializer_ThenReadAndWriteToVarInLoopContinuing) {}

TEST_F(WgslWriter_ValueToLetTest, LoadVarInLoopBody_ThenReadAndWriteToVarInLoopContinuing) {}

}  // namespace
}  // namespace tint::wgsl::writer::raise