summaryrefslogtreecommitdiff
path: root/test/Analysis/GlobalsModRef
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-09-13 12:45:50 +0000
committerDuncan Sands <baldrick@free.fr>2008-09-13 12:45:50 +0000
commitb8ca4ff6439c1543a0c6729cbcd6c70c3be7dc3c (patch)
tree465c96bbb30ed24cef5f2e406f3a71e348b47148 /test/Analysis/GlobalsModRef
parent2aa0e649bfc0157ea08a1ba8f8c9e905ddb581b1 (diff)
downloadllvm-b8ca4ff6439c1543a0c6729cbcd6c70c3be7dc3c.tar.gz
llvm-b8ca4ff6439c1543a0c6729cbcd6c70c3be7dc3c.tar.bz2
llvm-b8ca4ff6439c1543a0c6729cbcd6c70c3be7dc3c.tar.xz
Fix PR2792: treat volatile loads as writing memory somewhere.
Treat stores as reading memory, just to play safe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/GlobalsModRef')
-rw-r--r--test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll b/test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll
new file mode 100644
index 0000000000..8ac9637a86
--- /dev/null
+++ b/test/Analysis/GlobalsModRef/2008-09-13-VolatileRead.ll
@@ -0,0 +1,9 @@
+; RUN: llvm-as < %s | opt -globalsmodref-aa -markmodref | llvm-dis | not grep read
+; PR2792
+
+@g = global i32 0 ; <i32*> [#uses=1]
+
+define i32 @f() {
+ %t = volatile load i32* @g ; <i32> [#uses=1]
+ ret i32 %t
+}