• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -split-dwarf-file=%t1.dwo -filetype=obj -o %t1.o < %s
2; RUN: llc -split-dwarf-file=%t2.dwo -filetype=obj -o %t2.o < %p/../Inputs/loclists-dwp-b.ll
3; RUN: llvm-dwp %t1.o %t2.o -o %t.dwp
4; RUN: llvm-dwarfdump -v %t.dwp | FileCheck %s
5
6; Make sure that 2 location lists from different units within a dwp file are
7; dumped correctly. The 2 location lists differ in the length of their address
8; ranges.
9;
10; Generate both .ll files with clang -S -emit-llvm from the following sources:
11; a.cpp:
12; void y();
13; void a(int i) {
14;   y();
15;   asm("" : : : "rdi");
16; }
17;
18; b.cpp:
19; void b(int i) { asm("" : : : "rdi"); }
20
21; CHECK:      DW_AT_location [DW_FORM_sec_offset]   (0x00000000
22; CHECK-NEXT: DW_LLE_startx_length (0x0000000000000000, 0x0000000000000006): DW_OP_reg5 RDI
23; CHECK-NEXT: DW_LLE_startx_length (0x0000000000000001, 0x0000000000000002): DW_OP_GNU_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value)
24
25; CHECK:      DW_AT_location [DW_FORM_sec_offset]   (0x00000000
26; CHECK-NEXT: DW_LLE_startx_length (0x0000000000000000, 0x0000000000000000): DW_OP_reg5 RDI
27; CHECK-NEXT: DW_LLE_startx_length (0x0000000000000001, 0x0000000000000001): DW_OP_GNU_entry_value(DW_OP_reg5 RDI), DW_OP_stack_value)
28
29target triple = "x86_64-unknown-linux-gnu"
30
31define dso_local void @_Z1ai(i32 %i) local_unnamed_addr !dbg !7 {
32entry:
33  call void @llvm.dbg.value(metadata i32 %i, metadata !12, metadata !DIExpression()), !dbg !13
34  tail call void @_Z1yv(), !dbg !14
35  tail call void asm sideeffect "", "~{rdi},~{dirflag},~{fpsr},~{flags}"(), !dbg !15, !srcloc !16
36  ret void, !dbg !17
37}
38
39declare dso_local void @_Z1yv() local_unnamed_addr
40
41declare void @llvm.dbg.value(metadata, metadata, metadata)
42
43!llvm.dbg.cu = !{!0}
44!llvm.module.flags = !{!3, !4, !5}
45!llvm.ident = !{!6}
46
47!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
48!1 = !DIFile(filename: "a.cpp", directory: "/home/test/PRs/PR38990")
49!2 = !{}
50!3 = !{i32 2, !"Dwarf Version", i32 4}
51!4 = !{i32 2, !"Debug Info Version", i32 3}
52!5 = !{i32 1, !"wchar_size", i32 4}
53!6 = !{!"clang version 8.0.0"}
54!7 = distinct !DISubprogram(name: "a", linkageName: "_Z1ai", scope: !1, file: !1, line: 2, type: !8, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !11)
55!8 = !DISubroutineType(types: !9)
56!9 = !{null, !10}
57!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
58!11 = !{!12}
59!12 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 2, type: !10)
60!13 = !DILocation(line: 2, column: 12, scope: !7)
61!14 = !DILocation(line: 3, column: 3, scope: !7)
62!15 = !DILocation(line: 4, column: 3, scope: !7)
63!16 = !{i32 41}
64!17 = !DILocation(line: 5, column: 1, scope: !7)
65