diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-06-18 07:23:25 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-06-18 07:23:25 +0000 |
commit | 5a72d9f0be18b125296d4fdac729ed4911c40ce7 (patch) | |
tree | eeaebda99833decd041283ffdd66515d7b959640 /test | |
parent | 3ebb05d9a6bf6604a4b25770cfda1872983b03b2 (diff) | |
download | external_llvm-5a72d9f0be18b125296d4fdac729ed4911c40ce7.zip external_llvm-5a72d9f0be18b125296d4fdac729ed4911c40ce7.tar.gz external_llvm-5a72d9f0be18b125296d4fdac729ed4911c40ce7.tar.bz2 |
Add test for r133251.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133339 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Transforms/Mem2Reg/ignore-lifetime.ll | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/Transforms/Mem2Reg/ignore-lifetime.ll b/test/Transforms/Mem2Reg/ignore-lifetime.ll new file mode 100644 index 0000000..5e4f9bf --- /dev/null +++ b/test/Transforms/Mem2Reg/ignore-lifetime.ll @@ -0,0 +1,26 @@ +; RUN: opt -mem2reg -S -o - < %s | FileCheck %s + +declare void @llvm.lifetime.start(i64 %size, i8* nocapture %ptr) +declare void @llvm.lifetime.end(i64 %size, i8* nocapture %ptr) + +define void @test1() { +; CHECK: test1 +; CHECK-NOT: alloca + %A = alloca i32 + %B = bitcast i32* %A to i8* + call void @llvm.lifetime.start(i64 2, i8* %B) + store i32 1, i32* %A + call void @llvm.lifetime.end(i64 2, i8* %B) + ret void +} + +define void @test2() { +; CHECK: test2 +; CHECK-NOT: alloca + %A = alloca {i8, i16} + %B = getelementptr {i8, i16}* %A, i32 0, i32 0 + call void @llvm.lifetime.start(i64 2, i8* %B) + store {i8, i16} zeroinitializer, {i8, i16}* %A + call void @llvm.lifetime.end(i64 2, i8* %B) + ret void +} |