diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2009-10-18 00:42:07 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2009-10-18 00:42:07 +0000 |
commit | c1a38f59b5a258bfebbe553498c0e67f24ca74ec (patch) | |
tree | 4e9c3ba297ebca234f887b52c00a002954cbada2 /test/Analysis/BasicAA | |
parent | a22922d19abbea510ffac9b9c1224b6bc268a01d (diff) | |
download | external_llvm-c1a38f59b5a258bfebbe553498c0e67f24ca74ec.zip external_llvm-c1a38f59b5a258bfebbe553498c0e67f24ca74ec.tar.gz external_llvm-c1a38f59b5a258bfebbe553498c0e67f24ca74ec.tar.bz2 |
Add a couple new testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/BasicAA')
-rw-r--r-- | test/Analysis/BasicAA/memintrinsic-src.ll | 17 | ||||
-rw-r--r-- | test/Analysis/BasicAA/memintrisic-size.ll | 13 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/Analysis/BasicAA/memintrinsic-src.ll b/test/Analysis/BasicAA/memintrinsic-src.ll new file mode 100644 index 0000000..084c807 --- /dev/null +++ b/test/Analysis/BasicAA/memintrinsic-src.ll @@ -0,0 +1,17 @@ +; 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 new file mode 100644 index 0000000..480058b --- /dev/null +++ b/test/Analysis/BasicAA/memintrisic-size.ll @@ -0,0 +1,13 @@ +; 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 +} + |