#include "src/tint/lang/wgsl/ast/transform/direct_variable_access.h"
#include <memory>
#include <utility>
#include "src/tint/lang/wgsl/ast/transform/helper_test.h"
#include "src/tint/utils/text/string.h"
namespace tint::ast::transform {
namespace {
static DataMap EnablePrivate() { … }
static DataMap EnableFunction() { … }
namespace should_run {
DirectVariableAccessShouldRunTest;
TEST_F(DirectVariableAccessShouldRunTest, EmptyModule) { … }
}
namespace remove_uncalled {
DirectVariableAccessRemoveUncalledTest;
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrUniform) { … }
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrStorage) { … }
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrWorkgroup) { … }
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrPrivate_Disabled) { … }
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrPrivate_Enabled) { … }
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrFunction_Disabled) { … }
TEST_F(DirectVariableAccessRemoveUncalledTest, PtrFunction_Enabled) { … }
}
namespace pointer_chains_tests {
DirectVariableAccessPtrChainsTest;
TEST_F(DirectVariableAccessPtrChainsTest, ConstantIndices) { … }
TEST_F(DirectVariableAccessPtrChainsTest, ConstantIndices_ViaPointerIndex) { … }
TEST_F(DirectVariableAccessPtrChainsTest, HoistIndices) { … }
TEST_F(DirectVariableAccessPtrChainsTest, HoistInForLoopInit) { … }
TEST_F(DirectVariableAccessPtrChainsTest, HoistInForLoopCond) { … }
TEST_F(DirectVariableAccessPtrChainsTest, HoistInForLoopCont) { … }
TEST_F(DirectVariableAccessPtrChainsTest, HoistInWhileCond) { … }
}
namespace uniform_as_tests {
DirectVariableAccessUniformASTest;
TEST_F(DirectVariableAccessUniformASTest, Param_ptr_i32_read) { … }
TEST_F(DirectVariableAccessUniformASTest, Param_ptr_vec4i32_Via_array_DynamicRead) { … }
TEST_F(DirectVariableAccessUniformASTest, Param_ptr_vec4i32_Via_array_DynamicRead_ViaPointerDot) { … }
TEST_F(DirectVariableAccessUniformASTest, CallChaining) { … }
TEST_F(DirectVariableAccessUniformASTest, CallChaining_ViaPointerDotOrIndex) { … }
TEST_F(DirectVariableAccessUniformASTest, CallChaining2) { … }
}
namespace storage_as_tests {
DirectVariableAccessStorageASTest;
TEST_F(DirectVariableAccessStorageASTest, Param_ptr_i32_Via_struct_read) { … }
TEST_F(DirectVariableAccessStorageASTest, Param_ptr_arr_i32_Via_struct_write) { … }
TEST_F(DirectVariableAccessStorageASTest, Param_ptr_vec4i32_Via_array_DynamicWrite) { … }
TEST_F(DirectVariableAccessStorageASTest, CallChaining) { … }
TEST_F(DirectVariableAccessStorageASTest, CallChaining_ViaPointerDotOrIndex) { … }
TEST_F(DirectVariableAccessStorageASTest, CallChaining2) { … }
}
namespace workgroup_as_tests {
DirectVariableAccessWorkgroupASTest;
TEST_F(DirectVariableAccessWorkgroupASTest, Param_ptr_vec4i32_Via_array_StaticRead) { … }
TEST_F(DirectVariableAccessWorkgroupASTest, Param_ptr_vec4i32_Via_array_StaticWrite) { … }
TEST_F(DirectVariableAccessWorkgroupASTest, CallChaining) { … }
TEST_F(DirectVariableAccessWorkgroupASTest, CallChaining_ViaPointerDotOrIndex) { … }
TEST_F(DirectVariableAccessWorkgroupASTest, CallChaining2) { … }
}
namespace private_as_tests {
DirectVariableAccessPrivateASTest;
TEST_F(DirectVariableAccessPrivateASTest, Enabled_Param_ptr_i32_read) { … }
TEST_F(DirectVariableAccessPrivateASTest, Enabled_Param_ptr_i32_write) { … }
TEST_F(DirectVariableAccessPrivateASTest, Enabled_Param_ptr_i32_Via_struct_read) { … }
TEST_F(DirectVariableAccessPrivateASTest, Disabled_Param_ptr_i32_Via_struct_read) { … }
TEST_F(DirectVariableAccessPrivateASTest, Enabled_Param_ptr_arr_i32_Via_struct_write) { … }
TEST_F(DirectVariableAccessPrivateASTest, Disabled_Param_ptr_arr_i32_Via_struct_write) { … }
TEST_F(DirectVariableAccessPrivateASTest, Enabled_Param_ptr_i32_mixed) { … }
TEST_F(DirectVariableAccessPrivateASTest, Disabled_Param_ptr_i32_mixed) { … }
TEST_F(DirectVariableAccessPrivateASTest, Enabled_CallChaining) { … }
TEST_F(DirectVariableAccessPrivateASTest, Enabled_CallChaining2) { … }
TEST_F(DirectVariableAccessPrivateASTest, Disabled_CallChaining) { … }
}
namespace function_as_tests {
DirectVariableAccessFunctionASTest;
TEST_F(DirectVariableAccessFunctionASTest, Enabled_LocalPtr) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_Param_ptr_i32_read) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_Param_ptr_i32_write) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_Param_ptr_i32_Via_struct_read) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_Param_ptr_arr_i32_Via_struct_write) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_Param_ptr_i32_mixed) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_CallChaining) { … }
TEST_F(DirectVariableAccessFunctionASTest, Enabled_CallChaining2) { … }
TEST_F(DirectVariableAccessFunctionASTest, Disabled_Param_ptr_i32_Via_struct_read) { … }
TEST_F(DirectVariableAccessFunctionASTest, Disabled_Param_ptr_arr_i32_Via_struct_write) { … }
TEST_F(DirectVariableAccessFunctionASTest, PointerForwarding_NoUse) { … }
}
namespace complex_tests {
DirectVariableAccessComplexTest;
TEST_F(DirectVariableAccessComplexTest, Param_ptr_mixed_vec4i32_ViaMultiple) { … }
TEST_F(DirectVariableAccessComplexTest, Indexing) { … }
TEST_F(DirectVariableAccessComplexTest, IndexingInPtrCall) { … }
TEST_F(DirectVariableAccessComplexTest, IndexingDualPointers) { … }
}
}
}