summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-02-04 05:16:46 +0000
committerOwen Anderson <resistor@mac.com>2009-02-04 05:16:46 +0000
commitfe9388ccb4d2449e8e6a62053479a0ba74ae0b2d (patch)
tree8a3d31f8efcb67c2e815938be17abd03952a7149 /test
parent39355f9fea790c5a1b12ef0fdcfeac3f533232ea (diff)
downloadllvm-fe9388ccb4d2449e8e6a62053479a0ba74ae0b2d.tar.gz
llvm-fe9388ccb4d2449e8e6a62053479a0ba74ae0b2d.tar.bz2
llvm-fe9388ccb4d2449e8e6a62053479a0ba74ae0b2d.tar.xz
Finish making AliasAnalysis aware of the fact that most atomic intrinsics only dereference their arguments, and enhance
BasicAA to make use of this fact when computing ModRef info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63718 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Analysis/BasicAA/cas.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/cas.ll b/test/Analysis/BasicAA/cas.ll
new file mode 100644
index 0000000000..9bbb5e7c37
--- /dev/null
+++ b/test/Analysis/BasicAA/cas.ll
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | opt -basicaa -gvn | llvm-dis | grep load | count 1
+
+@flag0 = internal global i32 zeroinitializer
+@turn = internal global i32 zeroinitializer
+
+
+define i32 @main() {
+ %a = load i32* @flag0
+ %b = tail call i32 @llvm.atomic.swap.i32.p0i32(i32* @turn, i32 1)
+ %c = load i32* @flag0
+ ret i32 %c
+}
+
+declare i32 @llvm.atomic.swap.i32.p0i32(i32*, i32) nounwind \ No newline at end of file