wgpu/tests/out/msl/control-flow.msl

110 lines
1.7 KiB
Plaintext
Raw Normal View History

// language: metal2.0
2021-05-03 04:18:35 +00:00
#include <metal_stdlib>
#include <simd/simd.h>
void switch_default_break(
int i
) {
switch(i) {
default: {
break;
}
}
}
void switch_case_break(
) {
switch(0) {
case 0: {
break;
}
default: {
break;
}
}
return;
}
void loop_switch_continue(
int x
) {
while(true) {
switch(x) {
case 1: {
continue;
}
default: {
break;
}
}
}
return;
}
struct main_Input {
2021-05-03 04:18:35 +00:00
};
kernel void main_(
2021-05-03 04:18:35 +00:00
metal::uint3 global_id [[thread_position_in_grid]]
) {
int pos;
2021-05-03 04:18:35 +00:00
metal::threadgroup_barrier(metal::mem_flags::mem_device);
metal::threadgroup_barrier(metal::mem_flags::mem_threadgroup);
switch(1) {
default: {
pos = 1;
break;
}
}
int _e4 = pos;
switch(_e4) {
case 1: {
pos = 0;
break;
}
case 2: {
pos = 1;
break;
}
case 3: {
pos = 2;
}
case 4: {
break;
}
default: {
pos = 3;
break;
}
}
2021-09-19 21:31:38 +00:00
switch(0u) {
case 0u: {
break;
}
default: {
break;
}
2021-09-19 21:31:38 +00:00
}
int _e10 = pos;
switch(_e10) {
case 1: {
pos = 0;
break;
}
case 2: {
pos = 1;
return;
}
case 3: {
pos = 2;
}
case 4: {
return;
}
default: {
pos = 3;
return;
}
}
2021-05-03 04:18:35 +00:00
}