| #include <metal_stdlib> |
| |
| using namespace metal; |
| |
| #define TINT_ISOLATE_UB(VOLATILE_NAME) \ |
| volatile bool VOLATILE_NAME = true; \ |
| if (VOLATILE_NAME) |
| |
| struct tint_private_vars_struct { |
| float2 v2f; |
| int3 v3i; |
| uint4 v4u; |
| bool2 v2b; |
| }; |
| |
| void foo(thread tint_private_vars_struct* const tint_private_vars) { |
| TINT_ISOLATE_UB(tint_volatile_true) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) { |
| (*(tint_private_vars)).v2f[i] = 1.0f; |
| (*(tint_private_vars)).v3i[i] = 1; |
| (*(tint_private_vars)).v4u[i] = 1u; |
| (*(tint_private_vars)).v2b[i] = true; |
| } |
| } |
| |
| kernel void tint_symbol() { |
| thread tint_private_vars_struct tint_private_vars = {}; |
| TINT_ISOLATE_UB(tint_volatile_true_1) for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)))) { |
| foo(&(tint_private_vars)); |
| } |
| return; |
| } |
| |