xref: /llvm-project/llvm/test/Bitcode/debug-loc-again.ll (revision 75819aedf6d774a424e35793b266442708e57050)
1538ef562SDuncan P. N. Exon Smith; RUN: llvm-as < %s | llvm-bcanalyzer -dump | FileCheck %s -check-prefix=BC
2538ef562SDuncan P. N. Exon Smith; PR23436: Actually emit DEBUG_LOC_AGAIN records.
3538ef562SDuncan P. N. Exon Smith
4538ef562SDuncan P. N. Exon Smith; BC: <DEBUG_LOC op
5538ef562SDuncan P. N. Exon Smith; BC: <DEBUG_LOC_AGAIN/>
6538ef562SDuncan P. N. Exon Smith; BC: <DEBUG_LOC op
7538ef562SDuncan P. N. Exon Smith; BC: <DEBUG_LOC_AGAIN/>
8538ef562SDuncan P. N. Exon Smith
9538ef562SDuncan P. N. Exon Smith; RUN: llvm-as < %s | llvm-dis | FileCheck %s
10538ef562SDuncan P. N. Exon Smith; RUN: verify-uselistorder %s
11538ef562SDuncan P. N. Exon Smith; Check that this round-trips correctly.
12538ef562SDuncan P. N. Exon Smith
13538ef562SDuncan P. N. Exon Smithdefine void @foo() {
14538ef562SDuncan P. N. Exon Smithentry:
15538ef562SDuncan P. N. Exon Smith  %a = add i32 0, 0, !dbg !3
16538ef562SDuncan P. N. Exon Smith  %b = add i32 0, 1, !dbg !3
17538ef562SDuncan P. N. Exon Smith  %c = add i32 0, 2, !dbg !4
18538ef562SDuncan P. N. Exon Smith  ret void, !dbg !4
19538ef562SDuncan P. N. Exon Smith}
20538ef562SDuncan P. N. Exon Smith
21538ef562SDuncan P. N. Exon Smith; CHECK-LABEL: entry:
22538ef562SDuncan P. N. Exon Smith; CHECK-NEXT: %a = add i32 0, 0, !dbg ![[LINE1:[0-9]+]]
23538ef562SDuncan P. N. Exon Smith; CHECK-NEXT: %b = add i32 0, 1, !dbg ![[LINE1]]
24538ef562SDuncan P. N. Exon Smith; CHECK-NEXT: %c = add i32 0, 2, !dbg ![[LINE2:[0-9]+]]
25538ef562SDuncan P. N. Exon Smith; CHECK-NEXT: ret void, !dbg ![[LINE2]]
26538ef562SDuncan P. N. Exon Smith; CHECK: ![[LINE1]] = !DILocation(line: 1,
27538ef562SDuncan P. N. Exon Smith; CHECK: ![[LINE2]] = !DILocation(line: 2,
28538ef562SDuncan P. N. Exon Smith
29538ef562SDuncan P. N. Exon Smith!llvm.module.flags = !{!0}
30936a2b09SDavide Italiano!llvm.dbg.cu = !{!1}
31538ef562SDuncan P. N. Exon Smith
32538ef562SDuncan P. N. Exon Smith!0 = !{i32 2, !"Debug Info Version", i32 3}
33*75819aedSAdrian Prantl!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !DIFile(filename: "f", directory: "/d"))
34*75819aedSAdrian Prantl!2 = distinct !DISubprogram(name: "foo", unit: !1)
35538ef562SDuncan P. N. Exon Smith!3 = !DILocation(line: 1, scope: !2)
36538ef562SDuncan P. N. Exon Smith!4 = !DILocation(line: 2, scope: !2)
37