Skip to content

Commit 4c94631

Browse files
committed
Add test for r133251.
llvm-svn: 133339
1 parent 9601ddb commit 4c94631

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
; RUN: opt -mem2reg -S -o - < %s | FileCheck %s
2+
3+
declare void @llvm.lifetime.start(i64 %size, i8* nocapture %ptr)
4+
declare void @llvm.lifetime.end(i64 %size, i8* nocapture %ptr)
5+
6+
define void @test1() {
7+
; CHECK: test1
8+
; CHECK-NOT: alloca
9+
%A = alloca i32
10+
%B = bitcast i32* %A to i8*
11+
call void @llvm.lifetime.start(i64 2, i8* %B)
12+
store i32 1, i32* %A
13+
call void @llvm.lifetime.end(i64 2, i8* %B)
14+
ret void
15+
}
16+
17+
define void @test2() {
18+
; CHECK: test2
19+
; CHECK-NOT: alloca
20+
%A = alloca {i8, i16}
21+
%B = getelementptr {i8, i16}* %A, i32 0, i32 0
22+
call void @llvm.lifetime.start(i64 2, i8* %B)
23+
store {i8, i16} zeroinitializer, {i8, i16}* %A
24+
call void @llvm.lifetime.end(i64 2, i8* %B)
25+
ret void
26+
}

0 commit comments

Comments
 (0)