blob: df06f9b6cb2ffc6f1fb8b3a79b5ac94b47f579be [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
threadgroup int* a;
threadgroup int* b;
};
#define TINT_ISOLATE_UB(VOLATILE_NAME) \
{volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
void foo(tint_module_vars_struct tint_module_vars) {
{
int i = 0;
while(true) {
TINT_ISOLATE_UB(tint_volatile_false)
int const v = i;
threadgroup_barrier(mem_flags::mem_threadgroup);
int const v_1 = (*tint_module_vars.a);
threadgroup_barrier(mem_flags::mem_threadgroup);
if ((v < v_1)) {
} else {
break;
}
{
threadgroup_barrier(mem_flags::mem_threadgroup);
int const v_2 = (*tint_module_vars.b);
threadgroup_barrier(mem_flags::mem_threadgroup);
i = as_type<int>((as_type<uint>(i) + as_type<uint>(v_2)));
}
continue;
}
}
}