llvm/test/Transforms/Inline/crash-lifetime-marker.ll
Akira Hatanaka ca9313e65e [InlineFunction] Don't add lifetime markers for zero-sized allocas.
This commit fixes the code which adds lifetime markers in InlineFunction to skip
zero-sized allocas instead of asserting on them.

rdar://problem/20531155


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235312 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 16:11:05 +00:00

25 lines
700 B
LLVM

; RUN: opt < %s -inline -S | FileCheck %s
; 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
; CHECK-NOT: call void @llvm.lifetime.start(
; CHECK: call i32 @callee2(i8* [[ALLOCA]])
; CHECK-NOT: call void @llvm.lifetime.end(
define i32 @caller1(i32 %count) {
%call0 = call i32 @callee1(i32 0)
ret i32 %call0
}