blob: e39f70c0e30990970f195cfb5cbc4e8bacd83be3 [file] [log] [blame]
Pavel Labath2f088112018-08-07 09:54:52 +00001; 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
Pavel Labath10d87ab2018-08-28 14:46:29 +000010; three times and modified by hand. The modifications consisted of modifying the
11; compilation directory and the variable names to trigger the insertion of names
12; in different order.
Pavel Labath2f088112018-08-07 09:54:52 +000013
14; CHECK: .debug_info contents:
15; CHECK: DW_TAG_compile_unit
David Blaikie9efb0152018-12-22 08:43:08 +000016; CHECK: DW_AT_comp_dir [DW_FORM_strx1] (indexed (00000000) string = "X3")
Pavel Labath2f088112018-08-07 09:54:52 +000017; CHECK: DW_TAG_compile_unit
David Blaikie9efb0152018-12-22 08:43:08 +000018; CHECK: DW_AT_comp_dir [DW_FORM_strx1] (indexed (00000001) string = "X2")
Pavel Labath2f088112018-08-07 09:54:52 +000019; CHECK: DW_TAG_compile_unit
David Blaikie9efb0152018-12-22 08:43:08 +000020; CHECK: DW_AT_comp_dir [DW_FORM_strx1] (indexed (00000002) string = "X1")
Pavel Labath2f088112018-08-07 09:54:52 +000021; CHECK: .debug_info.dwo contents:
22
23; CHECK: .debug_str contents:
24; CHECK: 0x[[X3:[0-9a-f]*]]: "X3"
25; CHECK: 0x[[X1:[0-9a-f]*]]: "X1"
26; CHECK: 0x[[X2:[0-9a-f]*]]: "X2"
27
28; CHECK: .debug_str_offsets contents:
29; CHECK: Format = DWARF32, Version = 5
Pavel Labath2f088112018-08-07 09:54:52 +000030; CHECK-NEXT: [[X3]] "X3"
31; CHECK-NEXT: [[X2]] "X2"
32; CHECK-NEXT: [[X1]] "X1"
David Blaikie560ff352018-12-14 22:44:46 +000033; CHECK-NEXT: "foo.dwo"
Pavel Labath2f088112018-08-07 09:54:52 +000034; CHECK-EMPTY:
35
36
37
38!llvm.dbg.cu = !{!10, !20, !30}
39!llvm.module.flags = !{!0, !1, !2}
40!llvm.ident = !{!3}
41
42!0 = !{i32 2, !"Dwarf Version", i32 5}
43!1 = !{i32 2, !"Debug Info Version", i32 3}
44!2 = !{i32 1, !"wchar_size", i32 4}
45!3 = !{!"clang version 7.0.0 (trunk 337353) (llvm/trunk 337361)"}
46
47
48@X1 = dso_local global i32 0, align 4, !dbg !11
49
50!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)
51!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression())
52!12 = distinct !DIGlobalVariable(name: "X1", scope: !10, file: !16, line: 1, type: !17, isLocal: false, isDefinition: true)
53!13 = !DIFile(filename: "-", directory: "X3", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e")
54!14 = !{}
55!15 = !{!11}
56!16 = !DIFile(filename: "<stdin>", directory: "X3", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e")
57!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
58
59
60@X2 = dso_local global i32 0, align 4, !dbg !21
61
62!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)
63!21 = !DIGlobalVariableExpression(var: !22, expr: !DIExpression())
64!22 = distinct !DIGlobalVariable(name: "X2", scope: !20, file: !26, line: 1, type: !27, isLocal: false, isDefinition: true)
65!23 = !DIFile(filename: "-", directory: "X2", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e")
66!24 = !{}
67!25 = !{!21}
68!26 = !DIFile(filename: "<stdin>", directory: "X2", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e")
69!27 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
70
71
72@X3 = dso_local global i32 0, align 4, !dbg !31
73
74!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)
75!31 = !DIGlobalVariableExpression(var: !32, expr: !DIExpression())
76!32 = distinct !DIGlobalVariable(name: "X3", scope: !30, file: !36, line: 1, type: !37, isLocal: false, isDefinition: true)
77!33 = !DIFile(filename: "-", directory: "X1", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e")
78!34 = !{}
79!35 = !{!31}
80!36 = !DIFile(filename: "<stdin>", directory: "X1", checksumkind: CSK_MD5, checksum: "f2e6e10e303927a308f1645fbf6f710e")
81!37 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)