blob: d044fb0c985c9f09a5374a6c1e2a92fc9729df14 [file] [log] [blame]
dan sinclair49d1a2d2022-06-16 12:01:27 +00001#include <metal_stdlib>
2
3using namespace metal;
Ben Clayton9be037c2024-01-19 20:58:56 +00004
Ben Clayton02262d82024-01-23 18:09:39 +00005#define TINT_ISOLATE_UB(VOLATILE_NAME) \
6 volatile bool VOLATILE_NAME = true; \
7 if (VOLATILE_NAME)
Ben Clayton9be037c2024-01-19 20:58:56 +00008
dan sinclair49d1a2d2022-06-16 12:01:27 +00009int f() {
10 int i = 0;
Ben Clayton02262d82024-01-23 18:09:39 +000011 TINT_ISOLATE_UB(tint_volatile_true) while((i < 4)) {
dan sinclair49d1a2d2022-06-16 12:01:27 +000012 i = as_type<int>((as_type<uint>(i) + as_type<uint>(1)));
13 }
14 return i;
15}
16