blob: e944287141491baad808e2e5ad03445614f7d09b [file] [log] [blame]
James Pricec58ba9e2024-08-29 03:27:16 +00001#include <metal_stdlib>
2
3using namespace metal;
4
5#define TINT_ISOLATE_UB(VOLATILE_NAME) \
David Neto012551a2024-10-15 16:00:17 +00006 {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;}
James Pricec58ba9e2024-08-29 03:27:16 +00007
8kernel void f() {
9 int i = 0;
10 bool tint_continue = false;
David Neto012551a2024-10-15 16:00:17 +000011 while(true) {
12 TINT_ISOLATE_UB(tint_volatile_false);
James Pricec58ba9e2024-08-29 03:27:16 +000013 tint_continue = false;
14 switch(i) {
15 case 0: {
16 tint_continue = true;
17 break;
18 }
19 default: {
20 break;
21 }
22 }
23 if (tint_continue) {
24 {
25 i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
26 if ((i >= 4)) { break; }
27 }
28 continue;
29 }
30 {
31 i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
32 if ((i >= 4)) { break; }
33 }
34 }
35 return;
36}
37