chromium/third_party/dawn/src/tint/lang/wgsl/ast/transform/promote_side_effects_to_decl_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 "src/tint/lang/wgsl/ast/transform/promote_side_effects_to_decl.h"

#include "src/tint/lang/wgsl/ast/transform/helper_test.h"

namespace tint::ast::transform {
namespace {

PromoteSideEffectsToDeclTest;

TEST_F(PromoteSideEffectsToDeclTest, EmptyModule) {}

TEST_F(PromoteSideEffectsToDeclTest, Unary_Arith_SE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_BothSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_LeftSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_RightSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_LeftmostSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_RightmostSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_MiddleSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_ThreeSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Constants_NoRecvSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Constants_RecvSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Constants_ConstAndSEAndVar) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Constants_VarAndSEAndConst) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Constants_SEAndVarAndConstAndVar) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Builtins_WithSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Builtins_NoSEAndVar) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Builtins_NoSEAndSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_Vector_RightSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InCall) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InTypeInit) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InTypeConversion) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InIntrinsic) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InMemberAccessor) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InUnary) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InBitcast) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InForLoopInit) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InForLoopCond) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InForLoopCont) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InForLoopInitCondCont) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InWhileCond) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InElseIf) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InElseIfChain) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InReturn) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Arith_InSwitch) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_LeftSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_RightSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_BothSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_LeftmostSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_RightmostSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_MiddleSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_Constants_NoRecvSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_Constants_RecvSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_Constants_ConstAndSEAndVar) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_Constants_VarAndSEAndConst) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_Constants_SEAndVarAndConstAndVar) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_MixedSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_NestedAnds) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_NestedOrs) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_MultipleStatements) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InCall) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InTypeInit) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InTypeConversion) {}

// Make sure we process logical binary expressions of non-logical binary
// expressions.
TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_OfNonLogical) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InIntrinsic) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InMemberAccessor) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InUnary) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InBitcast) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InForLoopInit) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InForLoopCond) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InForLoopCont) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InForLoopInitCondCont) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InWhileCond) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InElseIf) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Logical_InElseIfChain) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_NoSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_OneSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_AllSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_MiddleNotSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_InBinary) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_2D_LeftSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_2D_RightSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_2D_BothSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_2D_LeftSE_ViaPointerIndex) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_2D_RightSE_ViaPointerIndex) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_2D_BothSE_ViaPointerIndex) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToPhony) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToArray1D) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToArray2D) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToArray3D) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToArray_FromArray) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToVec_BothSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToVec_LeftSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Assignment_ToVec_RightSE) {}

TEST_F(PromoteSideEffectsToDeclTest, TypeInitializer_Struct) {}

TEST_F(PromoteSideEffectsToDeclTest, TypeInitializer_Array1D) {}

TEST_F(PromoteSideEffectsToDeclTest, TypeInitializer_Array2D) {}

TEST_F(PromoteSideEffectsToDeclTest, MemberAccessor_Vec) {}

TEST_F(PromoteSideEffectsToDeclTest, MemberAccessor_Struct) {}

TEST_F(PromoteSideEffectsToDeclTest, MemberAccessor_Struct_Mixed) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_Plus_SE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_Of_SE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor2_Of_LeftSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor2_Of_RightSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor2_Of_SEAndVar) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor2_Of_VarAndSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessorOfVar_Plus_SE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessor_Plus_IndexAccessorOfSE) {}

TEST_F(PromoteSideEffectsToDeclTest, AssignTo_IndexAccessorOfIndexAccessorOfSE) {}

TEST_F(PromoteSideEffectsToDeclTest, AssignTo_IndexAccessorOfIndexAccessorOfLiteralPlusSE) {}

TEST_F(PromoteSideEffectsToDeclTest,
       AssignTo_IndexAccessorOfIndexAccessorOfLiteralPlusIndexAccessorOfSE) {}

TEST_F(PromoteSideEffectsToDeclTest, IndexAccessorOfLhsSERhsSE) {}

TEST_F(PromoteSideEffectsToDeclTest, BinaryIndexAccessorOfLhsSERhsSE) {}

TEST_F(PromoteSideEffectsToDeclTest, BinaryMemberAccessorPlusSE) {}

TEST_F(PromoteSideEffectsToDeclTest, BinaryMemberAccessorPlusSE_ViaPointerDot) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_ReadOnlyArgAndSE) {}

TEST_F(PromoteSideEffectsToDeclTest, Call_PtrArgAndSE) {}

TEST_F(PromoteSideEffectsToDeclTest, TypeInit_VarPlusI32InitPlusVar) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Mixed_ArithPlusLogical) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Mixed_LogicalPlusArith) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Mixed_ArithAndLogicalArgs) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Mixed_LogicalAndArithArgs) {}

TEST_F(PromoteSideEffectsToDeclTest, Binary_Mixed_Complex) {}

TEST_F(PromoteSideEffectsToDeclTest, TextureSamplerParameter) {}

TEST_F(PromoteSideEffectsToDeclTest, BuiltinReturnType) {}

TEST_F(PromoteSideEffectsToDeclTest, Bug1963) {}

}  // namespace
}  // namespace tint::ast::transform