| // |
| // main1 |
| // |
| #include <metal_stdlib> |
| using namespace metal; |
| |
| struct tint_module_vars_struct { |
| const constant int* a; |
| }; |
| |
| void uses_a(tint_module_vars_struct tint_module_vars) { |
| int const foo = (*tint_module_vars.a); |
| } |
| |
| [[max_total_threads_per_threadgroup(1)]] |
| kernel void main1(const constant int* a [[buffer(30)]]) { |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.a=a}; |
| uses_a(tint_module_vars); |
| } |
| // |
| // main2 |
| // |
| #include <metal_stdlib> |
| using namespace metal; |
| |
| struct tint_module_vars_struct { |
| const constant int* a; |
| }; |
| |
| void uses_a(tint_module_vars_struct tint_module_vars) { |
| int const foo = (*tint_module_vars.a); |
| } |
| |
| void uses_uses_a(tint_module_vars_struct tint_module_vars) { |
| uses_a(tint_module_vars); |
| } |
| |
| [[max_total_threads_per_threadgroup(1)]] |
| kernel void main2(const constant int* a [[buffer(30)]]) { |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.a=a}; |
| uses_uses_a(tint_module_vars); |
| } |
| // |
| // main3 |
| // |
| #include <metal_stdlib> |
| using namespace metal; |
| |
| struct tint_module_vars_struct { |
| const constant int* b; |
| }; |
| |
| void uses_b(tint_module_vars_struct tint_module_vars) { |
| int const foo = (*tint_module_vars.b); |
| } |
| |
| [[max_total_threads_per_threadgroup(1)]] |
| kernel void main3(const constant int* b [[buffer(30)]]) { |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.b=b}; |
| uses_b(tint_module_vars); |
| } |
| // |
| // main4 |
| // |
| #include <metal_stdlib> |
| using namespace metal; |
| |
| [[max_total_threads_per_threadgroup(1)]] |
| kernel void main4() { |
| } |