blob: 9150b121c6919833e23452b581e547f7006599ca [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_module_vars_struct {
threadgroup int* a;
threadgroup int* b;
threadgroup int* c;
};
struct tint_symbol_6 {
int tint_symbol_5;
};
struct tint_symbol_4 {
int tint_symbol_3;
};
struct tint_symbol_2 {
int tint_symbol;
int tint_symbol_1;
};
void uses_a(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.a) = ((*tint_module_vars.a) + 1);
}
void uses_b(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.b) = ((*tint_module_vars.b) * 2);
}
void uses_a_and_b(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.b) = (*tint_module_vars.a);
}
void no_uses() {
}
void outer(tint_module_vars_struct tint_module_vars) {
(*tint_module_vars.a) = 0;
uses_a(tint_module_vars);
uses_a_and_b(tint_module_vars);
uses_b(tint_module_vars);
no_uses();
}
void main1_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) {
if ((tint_local_index == 0u)) {
(*tint_module_vars.a) = 0;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
(*tint_module_vars.a) = 42;
uses_a(tint_module_vars);
}
void main2_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) {
if ((tint_local_index == 0u)) {
(*tint_module_vars.b) = 0;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
(*tint_module_vars.b) = 7;
uses_b(tint_module_vars);
}
void main3_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) {
if ((tint_local_index == 0u)) {
(*tint_module_vars.a) = 0;
(*tint_module_vars.b) = 0;
}
threadgroup_barrier(mem_flags::mem_threadgroup);
outer(tint_module_vars);
no_uses();
}
kernel void main4() {
no_uses();
}
kernel void main1(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_6* v [[threadgroup(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.a=(&(*v).tint_symbol_5)};
main1_inner(tint_local_index, tint_module_vars);
}
kernel void main2(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_4* v_1 [[threadgroup(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.b=(&(*v_1).tint_symbol_3)};
main2_inner(tint_local_index, tint_module_vars);
}
kernel void main3(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_2* v_2 [[threadgroup(0)]]) {
tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.a=(&(*v_2).tint_symbol), .b=(&(*v_2).tint_symbol_1)};
main3_inner(tint_local_index, tint_module_vars);
}