brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · 0adb060 Raw
79 lines · plain
1; RUN: llc -O0 -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s2;3; CHECK: .debug_info contents:4; CHECK: DW_TAG_label5; CHECK-NEXT: DW_AT_name {{.*}}"top"6; CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] {{.*}}debug-label.c7; CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] {{.*}}48; CHECK-NEXT: DW_AT_decl_column [DW_FORM_data1] {{.*}}99; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] {{.*}}{{0x[0-9a-f]+}}10; CHECK: DW_TAG_label11; CHECK-NEXT: DW_AT_name {{.*}}"done"12; CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] {{.*}}debug-label.c13; CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] {{.*}}714; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] {{.*}}{{0x[0-9a-f]+}}15; CHECK-NOT: DW_AT_name {{.*}}"top"16;17; RUN: llc -O0 -o - %s | FileCheck %s -check-prefix=ASM18;19; ASM: [[TOP_LOW_PC:[.0-9a-zA-Z]+]]:{{[[:space:]].*}}DEBUG_LABEL: foo:top20; ASM: [[DONE_LOW_PC:[.0-9a-zA-Z]+]]:{{[[:space:]].*}}DEBUG_LABEL: foo:done21; ASM-LABEL: {{debug_info|dwinfo}}22; ASM: DW_TAG_label23; ASM-NEXT: DW_AT_name24; ASM: 1 {{.*}} DW_AT_decl_file25; ASM-NEXT: 4 {{.*}} DW_AT_decl_line26; ASM-NEXT: 9 {{.*}} DW_AT_decl_column27; ASM-NEXT: [[TOP_LOW_PC]]{{.*}} DW_AT_low_pc28; ASM: DW_TAG_label29; ASM-NEXT: DW_AT_name30; ASM: 1 {{.*}} DW_AT_decl_file31; ASM-NEXT: 7 {{.*}} DW_AT_decl_line32; ASM-NEXT: [[DONE_LOW_PC]]{{.*}} DW_AT_low_pc33 34source_filename = "debug-label.c"35 36define dso_local i32 @foo(i32 %a, i32 %b) !dbg !6 {37entry:38  %a.addr = alloca i32, align 439  %b.addr = alloca i32, align 440  %sum = alloca i32, align 441  store i32 %a, ptr %a.addr, align 442  store i32 %b, ptr %b.addr, align 443  br label %top44 45top:46  call void @llvm.dbg.label(metadata !10), !dbg !1147  %0 = load i32, ptr %a.addr, align 448  %1 = load i32, ptr %b.addr, align 449  %add = add nsw i32 %0, %150  store i32 %add, ptr %sum, align 451  br label %done52 53done:54  call void @llvm.dbg.label(metadata !12), !dbg !1355  %2 = load i32, ptr %sum, align 456  ret i32 %2, !dbg !1457}58 59declare void @llvm.dbg.label(metadata)60 61!llvm.dbg.cu = !{!0}62!llvm.module.flags = !{!4}63 64!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, emissionKind: FullDebug, enums: !2)65!1 = !DIFile(filename: "debug-label.c", directory: "./")66!2 = !{}67!3 = !{!10}68!4 = !{i32 2, !"Debug Info Version", i32 3}69!6 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !3)70!7 = !DISubroutineType(types: !8)71!8 = !{!9, !9, !9}72!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)73!10 = !DILabel(scope: !6, name: "top", file: !1, line: 4, column: 9)74!11 = !DILocation(line: 4, column: 1, scope: !6)75!12 = !DILabel(scope: !15, name: "done", file: !1, line: 7)76!13 = !DILocation(line: 7, column: 1, scope: !6)77!14 = !DILocation(line: 8, column: 3, scope: !6)78!15 = !DILexicalBlockFile(discriminator: 2, file: !1, scope: !6)79