[[]] var<storage, read_write> indices : array<u32>;
[[]] var<storage, read> buffer : array<u32, 3>;

[[stage(compute)]] fn main() {
  if (iAmNaughtyInvocation) {
    indices[0] = 1000;
  } else {
    indices[0] = 0;
  }
  
  // workgroupBarrier();
  
  buffer[indices[0]];
}


[[stage(compute)]] fn main() {
  if (iAmNaughtyInvocation) {
    indices[0] = 1000;
    buffer[indices[0]];
  } else {
    indices[0] = 0;
    // clamp
    let i : u32 = indices[0];
    let c = clamp(i, 0, N);
    buffer[c];
  }  
}
[[stage(compute)]] fn main() {
  if (iAmNaughtyInvocation) {
    indices[0] = 1000;
    buffer[indices[0]];
  } else if (someVar < 3u) {
    indices[0] = someVar;
    // no clamp
    buffer[indices[0]];
  }  
}