|
| 1 | +; REQUIRES: object-emission |
| 2 | +; RUN: llc -mtriple=x86_64-unknown-linux-gnu -split-dwarf-file=foo.dwo -filetype=obj < %s \ |
| 3 | +; RUN: | llvm-dwarfdump -v - | FileCheck %s |
| 4 | + |
| 5 | +; This triggers a situation where the order of entries in the .debug_str and |
| 6 | +; .debug_str_offsets sections does not match and makes sure that all entries are |
| 7 | +; still wired up correctly. |
| 8 | + |
| 9 | +; Produced with "clang -S -emit-llvm -gdwarf-5" from source "int X;", copied |
| 10 | +; three times and modified by hand. |
| 11 | + |
| 12 | +; CHECK: .debug_info contents: |
| 13 | +; CHECK: DW_TAG_compile_unit |
| 14 | +; CHECK: DW_AT_comp_dir [DW_FORM_strx1] ( indexed (00000001) string = "X3") |
| 15 | +; CHECK: DW_TAG_compile_unit |
| 16 | +; CHECK: DW_AT_comp_dir [DW_FORM_strx1] ( indexed (00000002) string = "X2") |
| 17 | +; CHECK: DW_TAG_compile_unit |
| 18 | +; CHECK: DW_AT_comp_dir [DW_FORM_strx1] ( indexed (00000003) string = "X1") |
| 19 | +; CHECK: .debug_info.dwo contents: |
| 20 | + |
| 21 | +; CHECK: .debug_str contents: |
| 22 | +; CHECK: 0x[[X3:[0-9a-f]*]]: "X3" |
| 23 | +; CHECK: 0x[[X1:[0-9a-f]*]]: "X1" |
| 24 | +; CHECK: 0x[[X2:[0-9a-f]*]]: "X2" |
| 25 | + |
| 26 | +; CHECK: .debug_str_offsets contents: |
| 27 | +; CHECK: Format = DWARF32, Version = 5 |
| 28 | +; CHECK-NEXT: 00000000 "foo.dwo" |
| 29 | +; CHECK-NEXT: [[X3]] "X3" |
| 30 | +; CHECK-NEXT: [[X2]] "X2" |
| 31 | +; CHECK-NEXT: [[X1]] "X1" |
| 32 | +; CHECK-EMPTY: |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +!llvm.dbg.cu = !{!10, !20, !30} |
| 37 | +!llvm.module.flags = !{!0, !1, !2} |
| 38 | +!llvm.ident = !{!3} |
| 39 | + |
| 40 | +!0 = !{i32 2, !"Dwarf Version", i32 5} |
| 41 | +!1 = !{i32 2, !"Debug Info Version", i32 3} |
| 42 | +!2 = !{i32 1, !"wchar_size", i32 4} |
| 43 | +!3 = !{!"clang version 7.0.0 (trunk 337353) (llvm/trunk 337361)"} |
| 44 | + |
| 45 | + |
| 46 | +@X1 = dso_local global i32 0, align 4, !dbg !11 |
| 47 | + |
| 48 | +!10 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !13, producer: "clang version 7.0.0 (trunk 337353) (llvm/trunk 337361)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !14, globals: !15) |
| 49 | +!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression()) |
| 50 | +!12 = distinct !DIGlobalVariable(name: "X1", scope: !10, file: !16, line: 1, type: !17, isLocal: false, isDefinition: true) |
| 51 | +!13 = !DIFile(filename: "-", directory: "X3", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e") |
| 52 | +!14 = !{} |
| 53 | +!15 = !{!11} |
| 54 | +!16 = !DIFile(filename: "<stdin>", directory: "X3", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e") |
| 55 | +!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 56 | + |
| 57 | + |
| 58 | +@X2 = dso_local global i32 0, align 4, !dbg !21 |
| 59 | + |
| 60 | +!20 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !23, producer: "clang version 7.0.0 (trunk 337353) (llvm/trunk 337361)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !24, globals: !25) |
| 61 | +!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression()) |
| 62 | +!22 = distinct !DIGlobalVariable(name: "X2", scope: !20, file: !26, line: 1, type: !27, isLocal: false, isDefinition: true) |
| 63 | +!23 = !DIFile(filename: "-", directory: "X2", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e") |
| 64 | +!24 = !{} |
| 65 | +!25 = !{!21} |
| 66 | +!26 = !DIFile(filename: "<stdin>", directory: "X2", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e") |
| 67 | +!27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 68 | + |
| 69 | + |
| 70 | +@X3 = dso_local global i32 0, align 4, !dbg !31 |
| 71 | + |
| 72 | +!30 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !33, producer: "clang version 7.0.0 (trunk 337353) (llvm/trunk 337361)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !34, globals: !35) |
| 73 | +!31 = !DIGlobalVariableExpression(var: !32, expr: !DIExpression()) |
| 74 | +!32 = distinct !DIGlobalVariable(name: "X3", scope: !30, file: !36, line: 1, type: !37, isLocal: false, isDefinition: true) |
| 75 | +!33 = !DIFile(filename: "-", directory: "X1", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e") |
| 76 | +!34 = !{} |
| 77 | +!35 = !{!31} |
| 78 | +!36 = !DIFile(filename: "<stdin>", directory: "X1", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e") |
| 79 | +!37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
0 commit comments