#include "src/tint/lang/wgsl/ast/transform/robustness.h"
#include "src/tint/lang/wgsl/ast/transform/helper_test.h"
namespace tint::ast::transform {
static std::ostream& operator<<(std::ostream& out, Robustness::Action action) { … }
namespace {
DataMap Config(Robustness::Action action, bool disable_runtime_sized_array_index_clamping = false) { … }
const char* Expect(Robustness::Action action,
const char* expect_ignore,
const char* expect_clamp,
const char* expect_predicate) { … }
RobustnessTest;
TEST_P(RobustnessTest, Read_ConstantSizedArrayVal_IndexWithLiteral) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayVal_IndexWithConst) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayVal_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayVal_IndexWithRuntimeArrayIndex) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayVal_IndexWithRuntimeExpression) { … }
TEST_P(RobustnessTest, Read_NestedConstantSizedArraysVal_IndexWithRuntimeExpressions) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayVal_IndexWithOverride) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithLiteral) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithConst) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithRuntimeArrayIndex) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithRuntimeArrayIndexViaPointerIndex) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithRuntimeExpression) { … }
TEST_P(RobustnessTest, Read_NestedConstantSizedArraysRef_IndexWithRuntimeExpressions) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayRef_IndexWithOverride) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayPtr_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_ConstantSizedArrayPtr_IndexWithRuntimeArrayIndex) { … }
TEST_P(RobustnessTest, Read_NestedConstantSizedArraysPtr_IndexWithRuntimeExpressions) { … }
TEST_P(RobustnessTest, Read_NestedConstantSizedArrays_MixedAccess) { … }
TEST_P(RobustnessTest, Assign_ConstantSizedArray_IndexWithLet) { … }
TEST_P(RobustnessTest, Assign_ConstantSizedArrayPtr_IndexWithLet) { … }
TEST_P(RobustnessTest, Assign_ConstantSizedArrayPtr_IndexWithRuntimeArrayIndex) { … }
TEST_P(RobustnessTest, Assign_NestedConstantSizedArraysPtr_IndexWithRuntimeExpressions) { … }
TEST_P(RobustnessTest, Assign_NestedConstantSizedArrays_MixedAccess) { … }
TEST_P(RobustnessTest, CompoundAssign_ConstantSizedArray_IndexWithLet) { … }
TEST_P(RobustnessTest, Increment_ConstantSizedArray_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_RuntimeArray_IndexWithLiteral) { … }
TEST_P(RobustnessTest, Read_Vector_IndexWithLiteral) { … }
TEST_P(RobustnessTest, Read_Vector_IndexWithConst) { … }
TEST_P(RobustnessTest, Read_Vector_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_Vector_IndexWithRuntimeExpression) { … }
TEST_P(RobustnessTest, Read_Vector_IndexWithRuntimeExpression_ViaPointerIndex) { … }
TEST_P(RobustnessTest, Read_Vector_SwizzleIndexWithGlobalVar) { … }
TEST_P(RobustnessTest, Read_Vector_SwizzleIndexWithRuntimeExpression) { … }
TEST_P(RobustnessTest, Read_Vector_SwizzleIndexWithRuntimeExpression_ViaPointerDot) { … }
TEST_P(RobustnessTest, Read_Vector_IndexWithOverride) { … }
TEST_P(RobustnessTest, Read_MatrixRef_IndexingWithLiterals) { … }
TEST_P(RobustnessTest, Read_MatrixRef_IndexWithRuntimeExpressionThenLiteral) { … }
TEST_P(RobustnessTest, Read_MatrixRef_IndexWithLiteralThenRuntimeExpression) { … }
TEST_P(RobustnessTest, Read_MatrixRef_IndexWithOverrideThenLiteral) { … }
TEST_P(RobustnessTest, Read_MatrixRef_IndexWithLetThenSwizzle) { … }
TEST_P(RobustnessTest, Read_MatrixRef_IndexWithLiteralThenOverride) { … }
TEST_P(RobustnessTest, Assign_Matrix_IndexWithLet) { … }
TEST_P(RobustnessTest, CompoundAssign_Matrix_IndexWithLet) { … }
TEST_P(RobustnessTest, TextureDimensions) { … }
TEST_P(RobustnessTest, TextureDimensions_Level) { … }
TEST_P(RobustnessTest, TextureGather) { … }
TEST_P(RobustnessTest, TextureGather_Array) { … }
TEST_P(RobustnessTest, TextureGatherCompare) { … }
TEST_P(RobustnessTest, TextureGatherCompare_Array) { … }
TEST_P(RobustnessTest, TextureLoad_1D) { … }
TEST_P(RobustnessTest, TextureLoad_2D) { … }
TEST_P(RobustnessTest, TextureLoad_2DArray) { … }
TEST_P(RobustnessTest, TextureLoad_3D) { … }
TEST_P(RobustnessTest, TextureLoad_Multisampled2D) { … }
TEST_P(RobustnessTest, TextureLoad_Depth2D) { … }
TEST_P(RobustnessTest, TextureLoad_Depth2DArray) { … }
TEST_P(RobustnessTest, TextureLoad_External) { … }
TEST_P(RobustnessTest, TextureNumLayers) { … }
TEST_P(RobustnessTest, TextureNumLevels) { … }
TEST_P(RobustnessTest, TextureNumSamples) { … }
TEST_P(RobustnessTest, TextureSample) { … }
TEST_P(RobustnessTest, TextureSample_Offset) { … }
TEST_P(RobustnessTest, TextureSample_ArrayIndex) { … }
TEST_P(RobustnessTest, TextureSampleBias) { … }
TEST_P(RobustnessTest, TextureSampleBias_Offset) { … }
TEST_P(RobustnessTest, TextureSampleBias_ArrayIndex) { … }
TEST_P(RobustnessTest, TextureSampleCompare) { … }
TEST_P(RobustnessTest, TextureSampleCompare_Offset) { … }
TEST_P(RobustnessTest, TextureSampleCompare_ArrayIndex) { … }
TEST_P(RobustnessTest, TextureSampleCompareLevel) { … }
TEST_P(RobustnessTest, TextureSampleCompareLevel_Offset) { … }
TEST_P(RobustnessTest, TextureSampleCompareLevel_ArrayIndex) { … }
TEST_P(RobustnessTest, TextureSampleGrad) { … }
TEST_P(RobustnessTest, TextureSampleGrad_Offset) { … }
TEST_P(RobustnessTest, TextureSampleGrad_ArrayIndex) { … }
TEST_P(RobustnessTest, TextureSampleLevel) { … }
TEST_P(RobustnessTest, TextureSampleLevel_Offset) { … }
TEST_P(RobustnessTest, TextureSampleLevel_ArrayIndex) { … }
TEST_P(RobustnessTest, TextureSampleBaseClampToEdge) { … }
TEST_P(RobustnessTest, ShadowedVariable) { … }
TEST_P(RobustnessTest, DontRenameSymbols) { … }
TEST_P(RobustnessTest, WorkgroupOverrideCount) { … }
TEST_P(RobustnessTest, AtomicLoad) { … }
TEST_P(RobustnessTest, AtomicAnd) { … }
TEST_P(RobustnessTest, WorkgroupUniformLoad) { … }
TEST_P(RobustnessTest, ArrayVal_ForLoopInit) { … }
TEST_P(RobustnessTest, ArrayVal_ForLoopCond) { … }
TEST_P(RobustnessTest, ArrayVal_ForLoopCont) { … }
TEST_P(RobustnessTest, TextureLoad_ForLoopInit) { … }
TEST_P(RobustnessTest, TextureLoad_ForLoopCond) { … }
TEST_P(RobustnessTest, TextureLoad_ForLoopCont) { … }
TEST_P(RobustnessTest, AtomicXor_ForLoopInit) { … }
TEST_P(RobustnessTest, AtomicXor_ForLoopCond) { … }
TEST_P(RobustnessTest, AtomicXor_ForLoopCont) { … }
TEST_P(RobustnessTest, Read_PrivatePointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Read_WorkgroupPointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Read_UniformPointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Read_StoragePointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Read_FunctionPointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Read_PrivatePointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_WorkgroupPointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_UniformPointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_StoragePointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_FunctionPointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Write_PrivatePointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Write_WorkgroupPointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Write_StoragePointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Write_FunctionPointerParameter_IndexWithConstant) { … }
TEST_P(RobustnessTest, Write_PrivatePointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Write_WorkgroupPointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Write_StoragePointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Write_FunctionPointerParameter_IndexWithLet) { … }
TEST_P(RobustnessTest, Read_disable_unsized_array_index_clamping_i32) { … }
TEST_P(RobustnessTest, Read_disable_unsized_array_index_clamping_u32) { … }
TEST_P(RobustnessTest, Read_disable_unsized_array_index_clamping_abstract_int) { … }
TEST_P(RobustnessTest, Read_disable_unsized_array_index_clamping_abstract_int_ViaPointerIndex) { … }
TEST_P(RobustnessTest, Assign_disable_unsized_array_index_clamping_i32) { … }
TEST_P(RobustnessTest, Assign_disable_unsized_array_index_clamping_u32) { … }
TEST_P(RobustnessTest, Assign_disable_unsized_array_index_clamping_abstract_int) { … }
TEST_P(RobustnessTest, Assign_disable_unsized_array_index_clamping_abstract_int_ViaPointerIndex) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}