Wolfgang Pieb | 6214c11 | 2018-10-19 19:23:16 +0000 | [diff] [blame] | 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: Addr idx 0 (w/ length 6): DW_OP_reg5 RDI) |
| 23 | |
| 24 | ; CHECK: DW_AT_location [DW_FORM_sec_offset] (0x00000000 |
| 25 | ; CHECK-NEXT: Addr idx 0 (w/ length 0): DW_OP_reg5 RDI) |
| 26 | |
| 27 | target triple = "x86_64-unknown-linux-gnu" |
| 28 | |
| 29 | define dso_local void @_Z1ai(i32 %i) local_unnamed_addr !dbg !7 { |
| 30 | entry: |
| 31 | call void @llvm.dbg.value(metadata i32 %i, metadata !12, metadata !DIExpression()), !dbg !13 |
| 32 | tail call void @_Z1yv(), !dbg !14 |
| 33 | tail call void asm sideeffect "", "~{rdi},~{dirflag},~{fpsr},~{flags}"(), !dbg !15, !srcloc !16 |
| 34 | ret void, !dbg !17 |
| 35 | } |
| 36 | |
| 37 | declare dso_local void @_Z1yv() local_unnamed_addr |
| 38 | |
| 39 | declare void @llvm.dbg.value(metadata, metadata, metadata) |
| 40 | |
| 41 | !llvm.dbg.cu = !{!0} |
| 42 | !llvm.module.flags = !{!3, !4, !5} |
| 43 | !llvm.ident = !{!6} |
| 44 | |
James Y Knight | 693d39d | 2019-01-15 16:18:52 +0000 | [diff] [blame] | 45 | !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) |
Wolfgang Pieb | 6214c11 | 2018-10-19 19:23:16 +0000 | [diff] [blame] | 46 | !1 = !DIFile(filename: "a.cpp", directory: "/home/test/PRs/PR38990") |
| 47 | !2 = !{} |
| 48 | !3 = !{i32 2, !"Dwarf Version", i32 4} |
| 49 | !4 = !{i32 2, !"Debug Info Version", i32 3} |
| 50 | !5 = !{i32 1, !"wchar_size", i32 4} |
James Y Knight | 693d39d | 2019-01-15 16:18:52 +0000 | [diff] [blame] | 51 | !6 = !{!"clang version 8.0.0"} |
Wolfgang Pieb | 6214c11 | 2018-10-19 19:23:16 +0000 | [diff] [blame] | 52 | !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) |
| 53 | !8 = !DISubroutineType(types: !9) |
| 54 | !9 = !{null, !10} |
| 55 | !10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 56 | !11 = !{!12} |
| 57 | !12 = !DILocalVariable(name: "i", arg: 1, scope: !7, file: !1, line: 2, type: !10) |
| 58 | !13 = !DILocation(line: 2, column: 12, scope: !7) |
| 59 | !14 = !DILocation(line: 3, column: 3, scope: !7) |
| 60 | !15 = !DILocation(line: 4, column: 3, scope: !7) |
| 61 | !16 = !{i32 41} |
| 62 | !17 = !DILocation(line: 5, column: 1, scope: !7) |