Fix an issue with the IR sink pass found by inspection. (I'm not sure anyone is...
[oota-llvm.git] / test / Transforms / Sink / basic.ll
index 54b7f1369de47a1f1e723b6ae62ac8f7f591c65a..81782e9d42c860d9edfa6adc4307855cd4a23db3 100644 (file)
@@ -20,3 +20,19 @@ true:
 false:
   ret i32 0
 }
+
+; But don't sink volatile loads...
+
+;      CHECK: @foo2
+;      CHECK: volatile load
+; CHECK-NEXT: store i32
+
+define i32 @foo2(i1 %z) {
+  %l = volatile load i32* @A
+  store i32 0, i32* @B
+  br i1 %z, label %true, label %false
+true:
+  ret i32 %l
+false:
+  ret i32 0
+}