summaryrefslogtreecommitdiff
path: root/test/Transforms/ScalarRepl/volatile.ll
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-28 20:16:43 +0000
committerChris Lattner <sabre@nondot.org>2009-01-28 20:16:43 +0000
commit6e733d34ca487ab7ff8a6def018a933620393869 (patch)
treee66fb645cda69ec44f784a95d3820fb1de577a05 /test/Transforms/ScalarRepl/volatile.ll
parent6c8e35fd97846ea82a7f91481a9af53ae6e1ec2e (diff)
downloadllvm-6e733d34ca487ab7ff8a6def018a933620393869.tar.gz
llvm-6e733d34ca487ab7ff8a6def018a933620393869.tar.bz2
llvm-6e733d34ca487ab7ff8a6def018a933620393869.tar.xz
Fix some issues with volatility, move "CanConvertToScalar" check
after the others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ScalarRepl/volatile.ll')
-rw-r--r--test/Transforms/ScalarRepl/volatile.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/ScalarRepl/volatile.ll b/test/Transforms/ScalarRepl/volatile.ll
new file mode 100644
index 0000000000..5f9fe0d89a
--- /dev/null
+++ b/test/Transforms/ScalarRepl/volatile.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {volatile load}
+; RUN: llvm-as < %s | opt -scalarrepl | llvm-dis | grep {volatile store}
+
+define i32 @voltest(i32 %T) {
+ %A = alloca {i32, i32}
+ %B = getelementptr {i32,i32}* %A, i32 0, i32 0
+ volatile store i32 %T, i32* %B
+
+ %C = getelementptr {i32,i32}* %A, i32 0, i32 1
+ %X = volatile load i32* %C
+ ret i32 %X
+}