aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-09-01 21:21:24 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-09-01 21:21:24 +0000
commit86b5db8c011d96e7b7af0299cc99c942b790499e (patch)
tree19dc496e4310a1bc0af04cd502942a3ba881e761 /test
parent89e0f4b5b07aad3b690efa426b8f4131043aec40 (diff)
downloadexternal_llvm-86b5db8c011d96e7b7af0299cc99c942b790499e.zip
external_llvm-86b5db8c011d96e7b7af0299cc99c942b790499e.tar.gz
external_llvm-86b5db8c011d96e7b7af0299cc99c942b790499e.tar.bz2
Fix an issue with the IR sink pass found by inspection. (I'm not sure anyone is actually using this, but might as well fix it since I found the issue.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138965 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/Sink/basic.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/Sink/basic.ll b/test/Transforms/Sink/basic.ll
index 54b7f13..81782e9 100644
--- a/test/Transforms/Sink/basic.ll
+++ b/test/Transforms/Sink/basic.ll
@@ -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
+}