aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-10-18 04:41:36 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-10-18 04:41:36 +0000
commit15d3c05adf7f133f4eb5264e4e9b31cdc60f39eb (patch)
tree9a3524860459e2803b8ae6d3e368fa8a3f094fb7
parent28717a8a60e6877eda842944393efa4c0ad2e006 (diff)
downloadexternal_llvm-15d3c05adf7f133f4eb5264e4e9b31cdc60f39eb.zip
external_llvm-15d3c05adf7f133f4eb5264e4e9b31cdc60f39eb.tar.gz
external_llvm-15d3c05adf7f133f4eb5264e4e9b31cdc60f39eb.tar.bz2
Merge tests into modref.ll. Also add a test for r84174 at Chris' behest!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84400 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/BasicAA/memintrinsic-src.ll17
-rw-r--r--test/Analysis/BasicAA/memintrisic-size.ll13
-rw-r--r--test/Analysis/BasicAA/modref.ll42
3 files changed, 41 insertions, 31 deletions
diff --git a/test/Analysis/BasicAA/memintrinsic-src.ll b/test/Analysis/BasicAA/memintrinsic-src.ll
deleted file mode 100644
index 084c807..0000000
--- a/test/Analysis/BasicAA/memintrinsic-src.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; RUN: opt -S -gvn -dse < %s | FileCheck %s
-
-declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
-
-define i8 @test1() {
-; CHECK: @test1
- %A = alloca i8
- %B = alloca i8
-
- store i8 2, i8* %B ;; Not written to by memcpy
-
- call void @llvm.memcpy.i8(i8* %A, i8* %B, i8 -1, i32 0)
-
- %C = load i8* %B
- ret i8 %C
-; CHECK-NEXT: ret i8 2
-}
diff --git a/test/Analysis/BasicAA/memintrisic-size.ll b/test/Analysis/BasicAA/memintrisic-size.ll
deleted file mode 100644
index 480058b..0000000
--- a/test/Analysis/BasicAA/memintrisic-size.ll
+++ /dev/null
@@ -1,13 +0,0 @@
-; RUN: opt -S -gvn < %s | FileCheck %s
-
-declare void @llvm.memset.i8(i8*, i8, i8, i32)
-
-define i8 @test(i8* %P) {
- %P2 = getelementptr i8* %P, i32 1000
- store i8 1, i8* %P2 ;; Not dead across memset
- call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0)
- %A = load i8* %P2
- ret i8 %A
-; CHECK: ret i8 1
-}
-
diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll
index 54d415e..b3d93ac 100644
--- a/test/Analysis/BasicAA/modref.ll
+++ b/test/Analysis/BasicAA/modref.ll
@@ -1,6 +1,9 @@
-; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
+; RUN: opt < %s -basicaa -gvn -dse -S | FileCheck %s
declare void @llvm.memset.i32(i8*, i8, i32, i32)
+declare void @llvm.memset.i8(i8*, i8, i8, i32)
+declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
+declare void @llvm.lifetime.end(i64, i8* nocapture)
declare void @external(i32*)
@@ -19,3 +22,40 @@ define i32 @test0(i8* %P) {
; CHECK: ret i32 0
}
+declare void @llvm.memcpy.i8(i8*, i8*, i8, i32)
+
+define i8 @test1() {
+; CHECK: @test1
+ %A = alloca i8
+ %B = alloca i8
+
+ store i8 2, i8* %B ;; Not written to by memcpy
+
+ call void @llvm.memcpy.i8(i8* %A, i8* %B, i8 -1, i32 0)
+
+ %C = load i8* %B
+ ret i8 %C
+; CHECK: ret i8 2
+}
+
+define i8 @test2(i8* %P) {
+; CHECK: @test2
+ %P2 = getelementptr i8* %P, i32 1000
+ store i8 1, i8* %P2 ;; Not dead across memset
+ call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0)
+ %A = load i8* %P2
+ ret i8 %A
+; CHECK: ret i8 1
+}
+
+define void @test3(i8* %P) {
+; CHECK: @test3
+ %P2 = getelementptr i8* %P, i32 2
+ store i8 1, i8* %P2 ;; Not read by lifetime.end
+; CHECK: store
+ call void @llvm.lifetime.end(i64 1, i8* %P)
+ store i8 2, i8* %P2
+; CHECK-NOT: store
+ ret void
+; CHECK: ret void
+} \ No newline at end of file