128 lines · plain
1; RUN: llc -O0 %s -mtriple=x86_64 -filetype=obj -o %t && llvm-dwarfdump -debug-info -v %t | FileCheck --check-prefix=NO-SECTIONS %s2; RUN: llc -O0 %s --basic-block-sections=all --unique-basic-block-section-names -mtriple=x86_64 -filetype=obj -o %t && llvm-dwarfdump -debug-info -v %t | FileCheck --check-prefix=BB-SECTIONS %s3; RUN: llc -O0 %s --basic-block-sections=all --unique-basic-block-section-names -mtriple=x86_64 -filetype=obj -split-dwarf-file=%t.dwo -o %t && llvm-dwarfdump -debug-info -v %t | FileCheck --check-prefix=BB-SECTIONS %s4; RUN: llc -O0 %s --basic-block-sections=all -mtriple=x86_64 -o - | FileCheck --check-prefix=BB-SECTIONS-ASM %s5; RUN: llc -O0 %s -mtriple=x86_64 -filetype=obj -o %t && llvm-dwarfdump -debug-line %t | FileCheck --check-prefix=BB-SECTIONS-LINE-TABLE %s6 7; From:8; 1 int foo(int a) {9; 2 if (a > 20)10; 3 return bar();11; 4 else12; 5 return baz();13; 6 }14 15; NO-SECTIONS: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000 ".text.hot.")16; NO-SECTIONS: DW_AT_high_pc [DW_FORM_data4] ({{.*}})17; BB-SECTIONS: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)18; BB-SECTIONS-NEXT: DW_AT_ranges [DW_FORM_sec_offset]19; BB-SECTIONS-NEXT: [{{.*}}) ".text.hot._Z3fooi"20; BB-SECTIONS-NEXT: [{{.*}}) ".text.hot._Z3fooi._Z3fooi.__part.1"21; BB-SECTIONS-NEXT: [{{.*}}) ".text.hot._Z3fooi._Z3fooi.__part.2"22; BB-SECTIONS-NEXT: [{{.*}}) ".text.hot._Z3fooi._Z3fooi.__part.3"23; BB-SECTIONS-ASM: _Z3fooi:24; BB-SECTIONS-ASM: .Ltmp{{[0-9]+}}:25; BB-SECTIONS-ASM-NEXT: .loc 1 2 9 prologue_end26; BB-SECTIONS-ASM: .Ltmp{{[0-9]+}}:27; BB-SECTIONS-ASM-NEXT: .loc 1 2 7 is_stmt28; BB-SECTIONS-ASM: _Z3fooi.__part.1:29; BB-SECTIONS-ASM: .LBB_END0_{{[0-9]+}}:30; BB-SECTIONS-ASM: .size _Z3fooi.__part.1, .LBB_END0_{{[0-9]+}}-_Z3fooi.__part.131; BB-SECTIONS-ASM: _Z3fooi.__part.2:32; BB-SECTIONS-ASM: .LBB_END0_{{[0-9]+}}:33; BB-SECTIONS-ASM: .size _Z3fooi.__part.2, .LBB_END0_{{[0-9]+}}-_Z3fooi.__part.234; BB-SECTIONS-ASM: _Z3fooi.__part.3:35; BB-SECTIONS-ASM: .LBB_END0_{{[0-9]+}}:36; BB-SECTIONS-ASM: .size _Z3fooi.__part.3, .LBB_END0_{{[0-9]+}}-_Z3fooi.__part.337; BB-SECTIONS-ASM: .Lfunc_end0:38; BB-SECTIONS-ASM: .Ldebug_ranges0:39; BB-SECTIONS-ASM-NEXT: .quad .Lfunc_begin040; BB-SECTIONS-ASM-NEXT: .quad .Lfunc_end041; BB-SECTIONS-ASM-NEXT: .quad _Z3fooi.__part.142; BB-SECTIONS-ASM-NEXT: .quad .LBB_END0_{{[0-9]+}}43; BB-SECTIONS-ASM-NEXT: .quad _Z3fooi.__part.244; BB-SECTIONS-ASM-NEXT: .quad .LBB_END0_{{[0-9]+}}45; BB-SECTIONS-ASM-NEXT: .quad _Z3fooi.__part.346; BB-SECTIONS-ASM-NEXT: .quad .LBB_END0_{{[0-9]+}}47; BB-SECTIONS-ASM-NEXT: .quad 048; BB-SECTIONS-ASM-NEXT: .quad 049; BB-SECTIONS-LINE-TABLE: 0x0000000000000000 1 0 1 0 0 0 is_stmt50; BB-SECTIONS-LINE-TABLE-NEXT: 0x0000000000000004 2 9 1 0 0 0 is_stmt prologue_end51; BB-SECTIONS-LINE-TABLE-NEXT: 0x0000000000000008 2 7 1 0 0 052; BB-SECTIONS-LINE-TABLE-NEXT: 0x000000000000000a 0 7 1 0 0 053; BB-SECTIONS-LINE-TABLE-NEXT: 0x000000000000000f 3 5 1 0 0 0 is_stmt54; BB-SECTIONS-LINE-TABLE-NEXT: 0x0000000000000015 0 5 1 0 0 055; BB-SECTIONS-LINE-TABLE-NEXT: 0x000000000000001a 5 5 1 0 0 0 is_stmt56; BB-SECTIONS-LINE-TABLE-NEXT: 0x000000000000001e 6 1 1 0 0 0 is_stmt57; BB-SECTIONS-LINE-TABLE-NEXT: 0x0000000000000022 6 1 1 0 0 0 epilogue_begin58; BB-SECTIONS-LINE-TABLE-NEXT: 0x0000000000000024 6 1 1 0 0 0 end_sequence59 60; Function Attrs: noinline nounwind optnone uwtable61define dso_local i32 @_Z3fooi(i32 %0) !dbg !7 !prof !34 !section_prefix !35 {62 %2 = alloca i32, align 463 %3 = alloca i32, align 464 store i32 %0, ptr %3, align 465 call void @llvm.dbg.declare(metadata ptr %3, metadata !11, metadata !DIExpression()), !dbg !1266 %4 = load i32, ptr %3, align 4, !dbg !1367 %5 = icmp sgt i32 %4, 20, !dbg !1568 br i1 %5, label %6, label %8, !dbg !16, !prof !3669 706: ; preds = %171 %7 = call i32 @bar()72 store i32 %7, ptr %2, align 4, !dbg !1773 br label %10, !dbg !1774 758: ; preds = %176 %9 = call i32 @baz()77 store i32 %9, ptr %2, align 4, !dbg !1878 br label %10, !dbg !1879 8010: ; preds = %8, %681 %11 = load i32, ptr %2, align 4, !dbg !1982 ret i32 %11, !dbg !1983}84 85; Function Attrs: nounwind readnone speculatable willreturn86declare void @llvm.dbg.declare(metadata, metadata, metadata)87declare i32 @bar()88declare i32 @baz()89 90!llvm.dbg.cu = !{!0}91!llvm.module.flags = !{!3, !4, !20}92 93!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 10.0.0 (git@github.com:google/llvm-propeller.git f9421ebf4b3d8b64678bf6c49d1607fdce3f50c5)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)94!1 = !DIFile(filename: "debuginfo.cc", directory: "/")95!2 = !{}96!3 = !{i32 2, !"Dwarf Version", i32 4}97!4 = !{i32 2, !"Debug Info Version", i32 3}98!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)99!8 = !DISubroutineType(types: !9)100!9 = !{!10, !10}101!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)102!11 = !DILocalVariable(name: "a", arg: 1, scope: !7, file: !1, line: 1, type: !10)103!12 = !DILocation(line: 1, column: 13, scope: !7)104!13 = !DILocation(line: 2, column: 7, scope: !14)105!14 = distinct !DILexicalBlock(scope: !7, file: !1, line: 2, column: 7)106!15 = !DILocation(line: 2, column: 9, scope: !14)107!16 = !DILocation(line: 2, column: 7, scope: !7)108!17 = !DILocation(line: 3, column: 5, scope: !14)109!18 = !DILocation(line: 5, column: 5, scope: !14)110!19 = !DILocation(line: 6, column: 1, scope: !7)111!20 = !{i32 1, !"ProfileSummary", !21}112!21 = !{!22, !23, !24, !25, !26, !27, !28, !29}113!22 = !{!"ProfileFormat", !"InstrProf"}114!23 = !{!"TotalCount", i64 10000}115!24 = !{!"MaxCount", i64 10}116!25 = !{!"MaxInternalCount", i64 1}117!26 = !{!"MaxFunctionCount", i64 1000}118!27 = !{!"NumCounts", i64 3}119!28 = !{!"NumFunctions", i64 5}120!29 = !{!"DetailedSummary", !30}121!30 = !{!31, !32, !33}122!31 = !{i32 10000, i64 100, i32 1}123!32 = !{i32 999900, i64 100, i32 1}124!33 = !{i32 999999, i64 1, i32 2}125!34 = !{!"function_entry_count", i64 7000}126!35 = !{!"function_section_prefix", !"hot"}127!36 = !{!"branch_weights", i32 6999, i32 1}128