Home | History | Annotate | Download | only in Inline
      1 ; RUN: opt < %s -inline -S | FileCheck %s
      2 
      3 ; InlineFunction would assert inside the loop that leaves lifetime markers if
      4 ; there was an zero-sized AllocaInst. Check that it doesn't assert and doesn't
      5 ; leave lifetime markers in that case.
      6 
      7 declare i32 @callee2(i8*)
      8 
      9 define i32 @callee1(i32 %count) {
     10   %a0 = alloca i8, i32 %count, align 4
     11   %call0 = call i32 @callee2(i8* %a0)
     12   ret i32 %call0
     13 }
     14 
     15 ; CHECK-LABEL: define i32 @caller1(
     16 ; CHECK: [[ALLOCA:%[a-z0-9\.]+]] = alloca i8
     17 ; CHECK-NOT: call void @llvm.lifetime.start(
     18 ; CHECK: call i32 @callee2(i8* [[ALLOCA]])
     19 ; CHECK-NOT: call void @llvm.lifetime.end(
     20 
     21 define i32 @caller1(i32 %count) {
     22   %call0 = call i32 @callee1(i32 0)
     23   ret i32 %call0
     24 }
     25