Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 1 | #include <metal_stdlib> |
| 2 | |
| 3 | using namespace metal; |
Ben Clayton | 9be037c | 2024-01-19 20:58:56 +0000 | [diff] [blame] | 4 | |
Ben Clayton | 02262d8 | 2024-01-23 18:09:39 +0000 | [diff] [blame] | 5 | #define TINT_ISOLATE_UB(VOLATILE_NAME) \ |
David Neto | 012551a | 2024-10-15 16:00:17 +0000 | [diff] [blame] | 6 | {volatile bool VOLATILE_NAME = false; if (VOLATILE_NAME) break;} |
Ben Clayton | 9be037c | 2024-01-19 20:58:56 +0000 | [diff] [blame] | 7 | |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 8 | kernel void tint_symbol() { |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 9 | bool tint_continue_1 = false; |
David Neto | 012551a | 2024-10-15 16:00:17 +0000 | [diff] [blame] | 10 | for(int i = 0; (i < 2); i = as_type<int>((as_type<uint>(i) + as_type<uint>(2)))) { |
| 11 | TINT_ISOLATE_UB(tint_volatile_false); |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 12 | tint_continue_1 = false; |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 13 | switch(i) { |
| 14 | case 0: { |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 15 | bool tint_continue = false; |
David Neto | 012551a | 2024-10-15 16:00:17 +0000 | [diff] [blame] | 16 | for(int j = 0; (j < 2); j = as_type<int>((as_type<uint>(j) + as_type<uint>(2)))) { |
| 17 | TINT_ISOLATE_UB(tint_volatile_false_1); |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 18 | tint_continue = false; |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 19 | switch(j) { |
| 20 | case 0: { |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 21 | tint_continue = true; |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 22 | break; |
| 23 | } |
| 24 | default: { |
| 25 | break; |
| 26 | } |
| 27 | } |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 28 | if (tint_continue) { |
| 29 | continue; |
| 30 | } |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 31 | } |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 32 | tint_continue_1 = true; |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 33 | break; |
| 34 | } |
| 35 | default: { |
| 36 | break; |
| 37 | } |
| 38 | } |
dan sinclair | 997bc01 | 2024-02-22 02:08:41 +0000 | [diff] [blame] | 39 | if (tint_continue_1) { |
| 40 | continue; |
| 41 | } |
Antonio Maiorano | d6f6f00 | 2023-09-13 17:50:46 +0000 | [diff] [blame] | 42 | } |
| 43 | return; |
| 44 | } |
| 45 | |