crash-lifetime-marker.ll 700 B

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