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