[tint][msl]: Use a volatile bool to control loop preservation

To preserve loops, compare the condition with the contents
of a volatile boolean variable that is always set to 'true'.

Do this instead of using __asm__(""); that has proved faulty
in certain macOS environments.

Bug: tint:2125
Change-Id: Ia700db8d8612006eb614c30e6c647ca30032d120
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/170720
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
diff --git a/test/tint/buffer/storage/static_index/write.wgsl.expected.msl b/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
index 93c261e..705ddf0 100644
--- a/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
+++ b/test/tint/buffer/storage/static_index/write.wgsl.expected.msl
@@ -14,6 +14,8 @@
     T elements[N];
 };
 
+constant static volatile bool tint_preserve_loop = true;
+
 struct tint_packed_vec3_f32_array_element {
   /* 0x0000 */ packed_float3 elements;
   /* 0x000c */ tint_array<int8_t, 4> tint_pad;
@@ -104,8 +106,7 @@
 }
 
 void assign_and_preserve_padding_3(device tint_array<tint_packed_vec3_f32_array_element, 2>* const dest, tint_array<float3, 2> value) {
-  for(uint i = 0u; (i < 2u); i = (i + 1u)) {
-    __asm__("");
+  for(uint i = 0u; ((i < 2u)) == tint_preserve_loop; i = (i + 1u)) {
     (*(dest))[i].elements = packed_float3(value[i]);
   }
 }