|
1 |
| -RUN: llvm-dwp %p/../Inputs/merge_v5/notypes/c.dwo %p/../Inputs/merge_v5/notypes/ab.dwp -o - | \ |
2 |
| -RUN: llvm-dwarfdump -v - | FileCheck --check-prefix=CHECK %s |
3 |
| - |
4 |
| -DWP from a DWO (c.dwo) and a DWP (ab.dwp, created from a.dwo and b.dwo) |
5 |
| -Make sure the entries for A and B are updated correctly when read/processed from ab.dwp |
6 |
| -a.cpp: |
7 |
| - struct foo { }; |
8 |
| - foo a; |
9 |
| - |
10 |
| -b.cpp: |
11 |
| - struct bar { }; |
12 |
| - void b(bar) { |
13 |
| - } |
14 |
| - |
15 |
| -c.cpp: |
16 |
| - typedef int baz; |
17 |
| - baz c() { |
18 |
| - } |
| 1 | +RUN: rm -rf %t && split-file %s %t && cd %t |
| 2 | +RUN: llc a.ll -o a.o -filetype=obj --split-dwarf-output=a.dwo --split-dwarf-file=a.dwo |
| 3 | +RUN: llc b.ll -o b.o -filetype=obj --split-dwarf-output=b.dwo --split-dwarf-file=b.dwo |
| 4 | +RUN: llc c.ll -o c.o -filetype=obj --split-dwarf-output=c.dwo --split-dwarf-file=c.dwo |
| 5 | +RUN: llvm-dwp a.dwo b.dwo -o ab.dwp |
| 6 | +RUN: llvm-dwp c.dwo ab.dwp -o merged.dwp |
| 7 | +RUN: llvm-dwarfdump -v merged.dwp | FileCheck --check-prefix=CHECK %s |
19 | 8 |
|
20 | 9 | CHECK-LABEL: .debug_abbrev.dwo contents:
|
21 | 10 | CHECK-LABEL: Abbrev table for offset:
|
@@ -46,3 +35,127 @@ CHECK-LABEL: .debug_str_offsets.dwo contents:
|
46 | 35 | CHECK: Contribution size = 32, Format = DWARF32, Version = 5
|
47 | 36 | CHECK: Contribution size = 24, Format = DWARF32, Version = 5
|
48 | 37 | CHECK: Contribution size = 28, Format = DWARF32, Version = 5
|
| 38 | + |
| 39 | +DWP from a DWO (c.dwo) and a DWP (ab.dwp, created from a.dwo and b.dwo) |
| 40 | +Make sure the entries for A and B are updated correctly when read/processed from ab.dwp |
| 41 | +;--- a.cpp |
| 42 | + struct foo { }; |
| 43 | + foo a; |
| 44 | +;--- b.cpp |
| 45 | + struct bar { }; |
| 46 | + void b(bar) { |
| 47 | + } |
| 48 | +;--- c.cpp |
| 49 | + typedef int baz; |
| 50 | + baz c() { |
| 51 | + } |
| 52 | +;--- gen |
| 53 | +clang-18 --target=x86_64-linux -g3 -gsplit-dwarf -S -emit-llvm -gsplit-dwarf a.cpp -o - |
| 54 | +echo '#--- b.ll' |
| 55 | +clang-18 --target=x86_64-linux -g3 -gsplit-dwarf -S -emit-llvm -gsplit-dwarf b.cpp -o - |
| 56 | +echo '#--- c.ll' |
| 57 | +clang-18 --target=x86_64-linux -g3 -gsplit-dwarf -S -emit-llvm -gsplit-dwarf c.cpp -o - |
| 58 | +;--- a.ll |
| 59 | +; ModuleID = 'a.cpp' |
| 60 | +source_filename = "a.cpp" |
| 61 | +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" |
| 62 | +target triple = "x86_64-unknown-linux" |
| 63 | + |
| 64 | +%struct.foo = type { i8 } |
| 65 | + |
| 66 | +@a = dso_local global %struct.foo zeroinitializer, align 1, !dbg !0 |
| 67 | + |
| 68 | +!llvm.dbg.cu = !{!2} |
| 69 | +!llvm.module.flags = !{!7, !8, !9, !10, !11, !12, !13} |
| 70 | + |
| 71 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 72 | +!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 2, type: !5, isLocal: false, isDefinition: true) |
| 73 | +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, isOptimized: false, runtimeVersion: 0, splitDebugFilename: "a.dwo", emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: GNU) |
| 74 | +!3 = !DIFile(filename: "a.cpp", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "394299a94a96cb48c0c9c95d7baf01f5") |
| 75 | +!4 = !{!0} |
| 76 | +!5 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !3, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !6, identifier: "_ZTS3foo") |
| 77 | +!6 = !{} |
| 78 | +!7 = !{i32 7, !"Dwarf Version", i32 5} |
| 79 | +!8 = !{i32 2, !"Debug Info Version", i32 3} |
| 80 | +!9 = !{i32 1, !"wchar_size", i32 4} |
| 81 | +!10 = !{i32 8, !"PIC Level", i32 2} |
| 82 | +!11 = !{i32 7, !"PIE Level", i32 2} |
| 83 | +!12 = !{i32 7, !"uwtable", i32 2} |
| 84 | +!13 = !{i32 7, !"frame-pointer", i32 2} |
| 85 | +#--- b.ll |
| 86 | +; ModuleID = 'b.cpp' |
| 87 | +source_filename = "b.cpp" |
| 88 | +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" |
| 89 | +target triple = "x86_64-unknown-linux" |
| 90 | + |
| 91 | +%struct.bar = type { i8 } |
| 92 | + |
| 93 | +; Function Attrs: mustprogress noinline nounwind optnone uwtable |
| 94 | +define dso_local void @_Z1b3bar() #0 !dbg !9 { |
| 95 | + %1 = alloca %struct.bar, align 1 |
| 96 | + call void @llvm.dbg.declare(metadata ptr %1, metadata !14, metadata !DIExpression()), !dbg !15 |
| 97 | + ret void, !dbg !16 |
| 98 | +} |
| 99 | + |
| 100 | +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) |
| 101 | +declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 |
| 102 | + |
| 103 | +attributes #0 = { mustprogress noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } |
| 104 | +attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } |
| 105 | + |
| 106 | +!llvm.dbg.cu = !{!0} |
| 107 | +!llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8} |
| 108 | + |
| 109 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, isOptimized: false, runtimeVersion: 0, splitDebugFilename: "b.dwo", emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: GNU) |
| 110 | +!1 = !DIFile(filename: "b.cpp", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "8195382ac12baa5edfe47e2e4725f4a7") |
| 111 | +!2 = !{i32 7, !"Dwarf Version", i32 5} |
| 112 | +!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 113 | +!4 = !{i32 1, !"wchar_size", i32 4} |
| 114 | +!5 = !{i32 8, !"PIC Level", i32 2} |
| 115 | +!6 = !{i32 7, !"PIE Level", i32 2} |
| 116 | +!7 = !{i32 7, !"uwtable", i32 2} |
| 117 | +!8 = !{i32 7, !"frame-pointer", i32 2} |
| 118 | +!9 = distinct !DISubprogram(name: "b", linkageName: "_Z1b3bar", scope: !1, file: !1, line: 2, type: !10, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !13) |
| 119 | +!10 = !DISubroutineType(types: !11) |
| 120 | +!11 = !{null, !12} |
| 121 | +!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "bar", file: !1, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !13, identifier: "_ZTS3bar") |
| 122 | +!13 = !{} |
| 123 | +!14 = !DILocalVariable(arg: 1, scope: !9, file: !1, line: 2, type: !12) |
| 124 | +!15 = !DILocation(line: 2, column: 13, scope: !9) |
| 125 | +!16 = !DILocation(line: 3, column: 3, scope: !9) |
| 126 | +#--- c.ll |
| 127 | +; ModuleID = 'c.cpp' |
| 128 | +source_filename = "c.cpp" |
| 129 | +target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128" |
| 130 | +target triple = "x86_64-unknown-linux" |
| 131 | + |
| 132 | +; Function Attrs: mustprogress noinline nounwind optnone uwtable |
| 133 | +define dso_local noundef i32 @_Z1cv() #0 !dbg !9 { |
| 134 | + call void @llvm.trap(), !dbg !14 |
| 135 | + unreachable, !dbg !14 |
| 136 | +} |
| 137 | + |
| 138 | +; Function Attrs: cold noreturn nounwind memory(inaccessiblemem: write) |
| 139 | +declare void @llvm.trap() #1 |
| 140 | + |
| 141 | +attributes #0 = { mustprogress noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } |
| 142 | +attributes #1 = { cold noreturn nounwind memory(inaccessiblemem: write) } |
| 143 | + |
| 144 | +!llvm.dbg.cu = !{!0} |
| 145 | +!llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8} |
| 146 | + |
| 147 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, isOptimized: false, runtimeVersion: 0, splitDebugFilename: "c.dwo", emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: GNU) |
| 148 | +!1 = !DIFile(filename: "c.cpp", directory: "/proc/self/cwd", checksumkind: CSK_MD5, checksum: "e508eeb01e2e608fe8713f9132696ef5") |
| 149 | +!2 = !{i32 7, !"Dwarf Version", i32 5} |
| 150 | +!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 151 | +!4 = !{i32 1, !"wchar_size", i32 4} |
| 152 | +!5 = !{i32 8, !"PIC Level", i32 2} |
| 153 | +!6 = !{i32 7, !"PIE Level", i32 2} |
| 154 | +!7 = !{i32 7, !"uwtable", i32 2} |
| 155 | +!8 = !{i32 7, !"frame-pointer", i32 2} |
| 156 | +!9 = distinct !DISubprogram(name: "c", linkageName: "_Z1cv", scope: !1, file: !1, line: 2, type: !10, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0) |
| 157 | +!10 = !DISubroutineType(types: !11) |
| 158 | +!11 = !{!12} |
| 159 | +!12 = !DIDerivedType(tag: DW_TAG_typedef, name: "baz", file: !1, line: 1, baseType: !13) |
| 160 | +!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 161 | +!14 = !DILocation(line: 2, column: 11, scope: !9) |
0 commit comments