60 lines · plain
1; Test DBG_LABEL MachineInstr for label debugging.2; REQUIRES: asserts3; RUN: llc -debug-only=isel %s -o /dev/null 2> %t.debug4; RUN: cat %t.debug | FileCheck %s --check-prefix=CHECKMI5;6; CHECKMI: DBG_LABEL "top", debug-location !97; CHECKMI: DBG_LABEL "done", debug-location !118;9; RUN: llc %s -o - | FileCheck %s --check-prefix=CHECKASM10;11; CHECKASM: DEBUG_LABEL: foo:top12; CHECKASM: DEBUG_LABEL: foo:done13 14source_filename = "debug-label-mi.c"15 16; Function Attrs: noinline nounwind optnone17define i32 @foo(i32 signext %a, i32 signext %b) #0 !dbg !4 {18entry:19 %a.addr = alloca i32, align 420 %b.addr = alloca i32, align 421 %sum = alloca i32, align 422 store i32 %a, ptr %a.addr, align 423 store i32 %b, ptr %b.addr, align 424 br label %top25 26top: ; preds = %entry27 call void @llvm.dbg.label(metadata !8), !dbg !928 %0 = load i32, ptr %a.addr, align 429 %1 = load i32, ptr %b.addr, align 430 %add = add nsw i32 %0, %131 store i32 %add, ptr %sum, align 432 br label %done33 34done: ; preds = %top35 call void @llvm.dbg.label(metadata !10), !dbg !1136 %2 = load i32, ptr %sum, align 437 ret i32 %238}39 40; Function Attrs: nounwind readnone speculatable41declare void @llvm.dbg.label(metadata)42 43attributes #0 = { noinline nounwind optnone uwtable }44 45!llvm.dbg.cu = !{!0}46!llvm.module.flags = !{!3}47 48!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, isOptimized: false, emissionKind: FullDebug, enums: !2)49!1 = !DIFile(filename: "debug-label-mi.c", directory: "./")50!2 = !{}51!3 = !{i32 2, !"Debug Info Version", i32 3}52!4 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, retainedNodes: !2)53!5 = !DISubroutineType(types: !6)54!6 = !{!7, !7, !7}55!7 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)56!8 = !DILabel(scope: !4, name: "top", file: !1, line: 4)57!9 = !DILocation(line: 4, column: 1, scope: !4)58!10 = !DILabel(scope: !4, name: "done", file: !1, line: 7)59!11 = !DILocation(line: 7, column: 1, scope: !4)60