2015-04-21 00:11:05 +08:00
|
|
|
; RUN: opt < %s -inline -S | FileCheck %s
|
2016-12-27 15:18:43 +08:00
|
|
|
; RUN: opt < %s -passes='cgscc(inline)' -S | FileCheck %s
|
2015-04-21 00:11:05 +08:00
|
|
|
|
|
|
|
; InlineFunction would assert inside the loop that leaves lifetime markers if
|
|
|
|
; there was an zero-sized AllocaInst. Check that it doesn't assert and doesn't
|
|
|
|
; leave lifetime markers in that case.
|
|
|
|
|
|
|
|
declare i32 @callee2(i8*)
|
|
|
|
|
|
|
|
define i32 @callee1(i32 %count) {
|
|
|
|
%a0 = alloca i8, i32 %count, align 4
|
|
|
|
%call0 = call i32 @callee2(i8* %a0)
|
|
|
|
ret i32 %call0
|
|
|
|
}
|
|
|
|
|
|
|
|
; CHECK-LABEL: define i32 @caller1(
|
|
|
|
; CHECK: [[ALLOCA:%[a-z0-9\.]+]] = alloca i8
|
2017-04-11 04:18:21 +08:00
|
|
|
; CHECK-NOT: call void @llvm.lifetime.start.p0i8(
|
2015-04-21 00:11:05 +08:00
|
|
|
; CHECK: call i32 @callee2(i8* [[ALLOCA]])
|
2017-04-11 04:18:21 +08:00
|
|
|
; CHECK-NOT: call void @llvm.lifetime.end.p0i8(
|
2015-04-21 00:11:05 +08:00
|
|
|
|
|
|
|
define i32 @caller1(i32 %count) {
|
|
|
|
%call0 = call i32 @callee1(i32 0)
|
|
|
|
ret i32 %call0
|
|
|
|
}
|