aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-03-28 21:31:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-03-28 21:31:24 +0000
commit8f3fabe0febb7335c4349d3d6081deca95419d48 (patch)
treeb9f9f4393c00ded51ad2cc1956d30d7aa583fdfa /test/Analysis
parent5b2f9136644c58ae32e00d8317540692a697d1c9 (diff)
Handle intrinsics in GlobalsModRef. Fixes pr12351.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r--test/Analysis/GlobalsModRef/pr12351.ll33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/Analysis/GlobalsModRef/pr12351.ll b/test/Analysis/GlobalsModRef/pr12351.ll
new file mode 100644
index 0000000000..1c5ac43f8d
--- /dev/null
+++ b/test/Analysis/GlobalsModRef/pr12351.ll
@@ -0,0 +1,33 @@
+; RUN: opt < %s -basicaa -globalsmodref-aa -gvn -S | FileCheck %s
+
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
+define void @foo(i8* %x, i8* %y) {
+ call void @llvm.memcpy.p0i8.p0i8.i32(i8* %x, i8* %y, i32 1, i32 1, i1 false);
+ ret void
+}
+
+define void @bar(i8* %y, i8* %z) {
+ %x = alloca i8
+ call void @foo(i8* %x, i8* %y)
+ %t = load i8* %x
+ store i8 %t, i8* %y
+; CHECK: store i8 %t, i8* %y
+ ret void
+}
+
+
+define i32 @foo2() {
+ %foo = alloca i32
+ call void @bar2(i32* %foo)
+ %t0 = load i32* %foo, align 4
+; CHECK: %t0 = load i32* %foo, align 4
+ ret i32 %t0
+}
+
+define void @bar2(i32* %foo) {
+ store i32 0, i32* %foo, align 4
+ tail call void @llvm.dbg.value(metadata !{}, i64 0, metadata !{})
+ ret void
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone