brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.7 KiB · c9db2d2 Raw
140 lines · plain
1; Generated from the following source compiled with clang++ -gmlt:2; void f1() {}3; void __attribute__((section("__TEXT,__bar"))) f2() {}4; void __attribute__((always_inline)) f3() { f1(); }5; void f4() { f3(); }6 7; Check that8;  * -gmlt includes no DW_TAG_subprograms for subprograms without inlined9;    subroutines.10;  * yet still produces DW_AT_ranges and a range list in debug_ranges that11;    describes those subprograms12 13; CHECK: DW_TAG_compile_unit14; CHECK:   DW_AT_ranges [DW_FORM_sec_offset] (0x0000000015; CHECK-NOT: {{DW_TAG|NULL}}16 17; Omitting the subprograms without inlined subroutines is not possible18; currently on Darwin as dsymutil will drop the whole CU if it has no subprograms19; (which happens with this optimization if there are no inlined subroutines).20 21; DARWIN:  DW_TAG_subprogram22; DARWIN-NOT: DW_TAG23; DARWIN:    DW_AT_name {{.*}} "f1"24; DARWIN-NOT: {{DW_TAG|NULL}}25; DARWIN:  DW_TAG_subprogram26; DARWIN-NOT: DW_TAG27; DARWIN:    DW_AT_name {{.*}} "f2"28; DARWIN-NOT: {{DW_TAG|NULL}}29; DARWIN:  DW_TAG_subprogram30; DARWIN-NOT: DW_TAG31; Can't check the abstract_origin value across the DARWIN/CHECK checking and32; ordering, so don't bother - just trust me, it refers to f3 down there.33; DARWIN:    DW_AT_abstract_origin34; DARWIN-NOT: {{DW_TAG|NULL}}35 36 37; FIXME: Emitting separate abstract definitions is inefficient when we could38; just attach the DW_AT_name to the inlined_subroutine directly. Except that39; would produce many string relocations. Implement string indexing in the40; skeleton CU to address the relocation problem, then remove abstract41; definitions from -gmlt here.42 43; CHECK: DW_TAG_subprogram44; CHECK-NEXT:     DW_AT_name {{.*}}"f3"45; CHECK-NEXT:     DW_AT_inline46 47; Check that we only provide the minimal attributes on a subprogram to save space.48; CHECK:   DW_TAG_subprogram49; CHECK-NEXT:     DW_AT_low_pc50; CHECK-NEXT:     DW_AT_high_pc51; CHECK-NEXT:     DW_AT_name52; CHECK-NOT: {{DW_TAG|DW_AT}}53; CHECK:     DW_TAG_inlined_subroutine54 55; As mentioned above - replace DW_AT_abstract_origin with DW_AT_name to save56; space once we have support for string indexing in non-dwo sections57 58; CHECK-NEXT:       DW_AT_abstract_origin {{.*}} "f3"59; CHECK-NEXT:       DW_AT_low_pc60; CHECK-NEXT:       DW_AT_high_pc61; CHECK-NEXT:       DW_AT_call_file62; CHECK-NEXT:       DW_AT_call_line63; CHECK-NEXT:       DW_AT_call_column64 65; Make sure we don't have any other subprograms here (subprograms with no66; inlined subroutines are omitted by design to save space)67 68; CHECK-NOT: {{DW_TAG|DW_AT}}69; CHECK: NULL70; CHECK-NOT: {{DW_TAG|DW_AT}}71; CHECK: NULL72 73; CHECK: .debug_ranges contents:74 75; ... some addresses (depends on platform (such as platforms with function76; reordering in the linker), and looks wonky on platforms with zero values77; written in relocation places (dumper needs to	be fixed to read the78; relocations rather than interpret that as the end of a range list))79 80; CHECK: 00000000 <End of list>81 82 83; Check that we don't emit any pubnames or pubtypes under -gmlt84; CHECK-NOT: .debug_pubnames contents:85; CHECK-NOT: .debug_pubtypes contents:86 87; Function Attrs: nounwind uwtable88define void @_Z2f1v() #0 !dbg !4 {89entry:90  ret void, !dbg !1391}92 93; Function Attrs: nounwind uwtable94define void @_Z2f2v() #0 section "__TEXT,__bar" !dbg !7 {95entry:96  ret void, !dbg !1497}98 99; Function Attrs: alwaysinline nounwind uwtable100define void @_Z2f3v() #1 !dbg !8 {101entry:102  call void @_Z2f1v(), !dbg !15103  ret void, !dbg !16104}105 106; Function Attrs: nounwind uwtable107define void @_Z2f4v() #0 !dbg !9 {108entry:109  call void @_Z2f1v() #2, !dbg !17110  ret void, !dbg !19111}112 113attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }114attributes #1 = { alwaysinline nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "use-soft-float"="false" }115attributes #2 = { nounwind }116 117!llvm.dbg.cu = !{!0}118!llvm.module.flags = !{!10, !11}119!llvm.ident = !{!12}120 121!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 ", isOptimized: false, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)122!1 = !DIFile(filename: "gmlt.cpp", directory: "/tmp/dbginfo")123!2 = !{}124!4 = distinct !DISubprogram(name: "f1", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 1, file: !1, scope: !5, type: !6, retainedNodes: !2)125!5 = !DIFile(filename: "gmlt.cpp", directory: "/tmp/dbginfo")126!6 = !DISubroutineType(types: !2)127!7 = distinct !DISubprogram(name: "f2", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2)128!8 = distinct !DISubprogram(name: "f3", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 3, file: !1, scope: !5, type: !6, retainedNodes: !2)129!9 = distinct !DISubprogram(name: "f4", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 4, file: !1, scope: !5, type: !6, retainedNodes: !2)130!10 = !{i32 2, !"Dwarf Version", i32 4}131!11 = !{i32 2, !"Debug Info Version", i32 3}132!12 = !{!"clang version 3.6.0 "}133!13 = !DILocation(line: 1, column: 12, scope: !4)134!14 = !DILocation(line: 2, column: 53, scope: !7)135!15 = !DILocation(line: 3, column: 44, scope: !8)136!16 = !DILocation(line: 3, column: 50, scope: !8)137!17 = !DILocation(line: 3, column: 44, scope: !8, inlinedAt: !18)138!18 = !DILocation(line: 4, column: 13, scope: !9)139!19 = !DILocation(line: 4, column: 19, scope: !9)140