debug-invoke.ll 991 B

12345678910111213141516171819202122232425262728293031323334353637
  1. ; RUN: opt < %s -always-inline -S | FileCheck %s
  2. ; Test that the debug location is preserved when rewriting an inlined call as an invoke
  3. ; CHECK: invoke void @test()
  4. ; CHECK-NEXT: to label {{.*}} unwind label {{.*}}, !dbg [[INL_LOC:!.*]]
  5. ; CHECK: [[SP:.*]] = !DISubprogram(
  6. ; CHECK: [[INL_LOC]] = !DILocation(line: 1, scope: [[SP]], inlinedAt: [[INL_AT:.*]])
  7. ; CHECK: [[INL_AT]] = distinct !DILocation(line: 2, scope: [[SP]])
  8. declare void @test()
  9. declare i32 @__gxx_personality_v0(...)
  10. attributes #0 = { alwaysinline }
  11. define void @inl() #0 {
  12. call void @test(), !dbg !3
  13. ret void
  14. }
  15. define void @caller() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
  16. invoke void @inl()
  17. to label %cont unwind label %lpad, !dbg !4
  18. cont:
  19. ret void
  20. lpad:
  21. landingpad { i8*, i32 }
  22. cleanup
  23. ret void
  24. }
  25. !llvm.module.flags = !{!1}
  26. !1 = !{i32 2, !"Debug Info Version", i32 3}
  27. !2 = !DISubprogram()
  28. !3 = !DILocation(line: 1, scope: !2)
  29. !4 = !DILocation(line: 2, scope: !2)