fortran-subprogram-attr.ll 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ; REQUIRES: object-emission
  2. ; Test for DISPFlagPure, DISPFlagElement and DISPFlagRecursive. These
  3. ; three DISPFlags are used to attach DW_AT_pure, DW_AT_element, and
  4. ; DW_AT_recursive attributes to DW_TAG_subprogram DIEs.
  5. ; -- test the resulting DWARF to make sure we're emitting
  6. ; DW_AT_{pure,elemental,recursive}.
  7. ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t.o
  8. ; RUN: llvm-dwarfdump -v -debug-info %t.o | FileCheck %s
  9. ; CHECK: DW_TAG_subprogram
  10. ; CHECK-DAG: DW_AT_name {{.*}} "subroutine1"
  11. ; CHECK-DAG: DW_AT_pure [DW_FORM_flag_present] (true)
  12. ; CHECK: DW_TAG_subprogram
  13. ; CHECK-DAG: DW_AT_name {{.*}} "subroutine2"
  14. ; CHECK-DAG: DW_AT_elemental [DW_FORM_flag_present] (true)
  15. ; CHECK: DW_TAG_subprogram
  16. ; CHECK-DAG: DW_AT_name {{.*}} "subroutine3"
  17. ; CHECK-DAG: DW_AT_recursive [DW_FORM_flag_present] (true)
  18. ; CHECK: DW_TAG_subprogram
  19. ; CHECK-DAG: DW_AT_name {{.*}} "subroutine4"
  20. ; CHECK-DAG: DW_AT_pure [DW_FORM_flag_present] (true)
  21. ; CHECK-DAG: DW_AT_elemental [DW_FORM_flag_present] (true)
  22. ; CHECK-DAG: DW_AT_recursive [DW_FORM_flag_present] (true)
  23. ; CHECK: {{DW_TAG|NULL}}
  24. ; Function Attrs: noinline nounwind optnone uwtable
  25. define dso_local void @subroutine1() !dbg !7 {
  26. entry:
  27. ret void, !dbg !10
  28. }
  29. ; Function Attrs: noinline nounwind optnone uwtable
  30. define dso_local void @subroutine2() !dbg !11 {
  31. entry:
  32. ret void, !dbg !12
  33. }
  34. ; Function Attrs: noinline nounwind optnone uwtable
  35. define dso_local void @subroutine3() !dbg !13 {
  36. entry:
  37. ret void, !dbg !14
  38. }
  39. ; Function Attrs: noinline nounwind optnone uwtable
  40. define dso_local void @subroutine4() !dbg !15 {
  41. entry:
  42. ret void, !dbg !16
  43. }
  44. !llvm.dbg.cu = !{!0}
  45. !llvm.module.flags = !{!3, !4, !5}
  46. !llvm.ident = !{!6}
  47. !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "c", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
  48. !1 = !DIFile(filename: "x.f", directory: "/tmp")
  49. !2 = !{}
  50. !3 = !{i32 2, !"Dwarf Version", i32 4}
  51. !4 = !{i32 2, !"Debug Info Version", i32 3}
  52. !5 = !{i32 1, !"wchar_size", i32 4}
  53. !6 = !{!"c"}
  54. !7 = distinct !DISubprogram(name: "subroutine1", scope: !1, file: !1, line: 1, type: !8, scopeLine: 2, spFlags: DISPFlagDefinition | DISPFlagPure, unit: !0, retainedNodes: !2)
  55. !8 = !DISubroutineType(types: !9)
  56. !9 = !{null}
  57. !10 = !DILocation(line: 3, column: 1, scope: !7)
  58. !11 = distinct !DISubprogram(name: "subroutine2", scope: !1, file: !1, line: 5, type: !8, scopeLine: 6, spFlags: DISPFlagDefinition | DISPFlagElemental, unit: !0, retainedNodes: !2)
  59. !12 = !DILocation(line: 7, column: 1, scope: !11)
  60. !13 = distinct !DISubprogram(name: "subroutine3", scope: !1, file: !1, line: 9, type: !8, scopeLine: 10, spFlags: DISPFlagDefinition | DISPFlagRecursive, unit: !0, retainedNodes: !2)
  61. !14 = !DILocation(line: 11, column: 1, scope: !13)
  62. !15 = distinct !DISubprogram(name: "subroutine4", scope: !1, file: !1, line: 13, type: !8, scopeLine: 14, spFlags: DISPFlagDefinition | DISPFlagPure | DISPFlagElemental | DISPFlagRecursive, unit: !0, retainedNodes: !2)
  63. !16 = !DILocation(line: 15, column: 1, scope: !15)