imported-name-inlined.ll 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ; REQUIRES: object-emission
  2. ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -v -debug-info - | FileCheck --implicit-check-not "{{DW_TAG|NULL}}" %s
  3. ; Generated from the following source:
  4. ; namespace ns {
  5. ; void f();
  6. ; }
  7. ; inline __attribute__((always_inline)) void f1() {
  8. ; using ns::f;
  9. ; f();
  10. ; }
  11. ; void f2() { f1(); }
  12. ; Ensure that top level imported declarations don't produce an extra degenerate
  13. ; concrete subprogram definition.
  14. ; FIXME: imported entities should only be emitted to the abstract origin if one is present
  15. ; CHECK: DW_TAG_compile_unit
  16. ; CHECK: DW_TAG_subprogram
  17. ; CHECK: DW_AT_name {{.*}} "f1"
  18. ; CHECK: DW_TAG_imported_declaration
  19. ; CHECK: NULL
  20. ; CHECK: DW_TAG_namespace
  21. ; CHECK: DW_TAG_subprogram
  22. ; CHECK: NULL
  23. ; CHECK: DW_TAG_subprogram
  24. ; CHECK: DW_AT_name {{.*}} "f2"
  25. ; CHECK: DW_TAG_inlined_subroutine
  26. ; CHECK: DW_TAG_imported_declaration
  27. ; CHECK: NULL
  28. ; CHECK: NULL
  29. ; CHECK: NULL
  30. ; Function Attrs: noinline
  31. define void @_Z2f2v() noinline !dbg !14 {
  32. entry:
  33. call void @_ZN2ns1fEv(), !dbg !15
  34. ret void, !dbg !17
  35. }
  36. declare void @_ZN2ns1fEv()
  37. !llvm.dbg.cu = !{!0}
  38. !llvm.module.flags = !{!10, !11, !12}
  39. !llvm.ident = !{!13}
  40. !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 309061) (llvm/trunk 309076)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, imports: !3)
  41. !1 = !DIFile(filename: "imported-name-inlined.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
  42. !2 = !{}
  43. !3 = !{!4}
  44. !4 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !5, entity: !8, file: !1, line: 5)
  45. !5 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 4, type: !6, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
  46. !6 = !DISubroutineType(types: !7)
  47. !7 = !{null}
  48. !8 = !DISubprogram(name: "f", linkageName: "_ZN2ns1fEv", scope: !9, file: !1, line: 2, type: !6, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: false)
  49. !9 = !DINamespace(name: "ns", scope: null)
  50. !10 = !{i32 2, !"Dwarf Version", i32 4}
  51. !11 = !{i32 2, !"Debug Info Version", i32 3}
  52. !12 = !{i32 1, !"wchar_size", i32 4}
  53. !13 = !{!"clang version 6.0.0 (trunk 309061) (llvm/trunk 309076)"}
  54. !14 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 8, type: !6, isLocal: false, isDefinition: true, scopeLine: 8, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
  55. !15 = !DILocation(line: 6, column: 3, scope: !5, inlinedAt: !16)
  56. !16 = distinct !DILocation(line: 8, column: 13, scope: !14)
  57. !17 = !DILocation(line: 8, column: 19, scope: !14)