Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / llvm-dwp / X86 / unknown-section-id.s
blob67865219a8e1bec07cb921f8e28fbe88f5584682
1 ## The test checks that llvm-dwp avoids an out of bound access when there is
2 ## an unknown section identifier in an index section. Without the fix, the test
3 ## failed when LLVM is built with UBSan.
4 ## Note that additional sections (.debug_abbrev.dwo, .debug_info.dwo, and
5 ## .debug_types.dwo) are required to reach the test points in the code.
7 # RUN: llvm-mc -triple x86_64-unknown-linux-gnu %s -filetype=obj -o %t.dwp
8 # RUN: llvm-dwp %t.dwp -o - | \
9 # RUN: llvm-dwarfdump -debug-cu-index -debug-tu-index - | \
10 # RUN: FileCheck %s
12 ## Check that all known sections are preserved and no data for unknown section
13 ## identifiers is copied.
15 # CHECK: .debug_cu_index contents:
16 # CHECK-NEXT: version = 2, units = 1, slots = 2
17 # CHECK: Index Signature INFO ABBREV
18 # CHECK-NOT: Unknown
19 # CHECK: -----
20 # CHECK-NEXT: 1 0x1100002222222222 [0x0000000000000000, 0x0000000000000014) [0x00000000, 0x00000009)
21 # CHECK-NOT: [
23 # CHECK: .debug_tu_index contents:
24 # CHECK-NEXT: version = 2, units = 1, slots = 2
25 # CHECK: Index Signature TYPES ABBREV
26 # CHECK-NOT: Unknown
27 # CHECK: -----
28 # CHECK-NEXT: 2 0x1100003333333333 [0x0000000000000000, 0x0000000000000019) [0x00000009, 0x00000014)
29 # CHECK-NOT: [
31 .section .debug_abbrev.dwo, "e", @progbits
32 .LCUAbbrevBegin:
33 .uleb128 1 # Abbreviation Code
34 .uleb128 0x11 # DW_TAG_compile_unit
35 .byte 0 # DW_CHILDREN_no
36 .uleb128 0x2131 # DW_AT_GNU_dwo_id
37 .uleb128 7 # DW_FORM_data8
38 .byte 0 # EOM(1)
39 .byte 0 # EOM(2)
40 .byte 0 # EOM(3)
41 .LCUAbbrevEnd:
43 .LTUAbbrevBegin:
44 .uleb128 1 # Abbreviation Code
45 .uleb128 0x41 # DW_TAG_type_unit
46 .byte 1 # DW_CHILDREN_yes
47 .byte 0 # EOM(1)
48 .byte 0 # EOM(2)
49 .uleb128 2 # Abbreviation Code
50 .uleb128 0x13 # DW_TAG_structure_type
51 .byte 0 # DW_CHILDREN_no
52 .byte 0 # EOM(1)
53 .byte 0 # EOM(2)
54 .byte 0 # EOM(3)
55 .LTUAbbrevEnd:
57 .section .debug_info.dwo, "e", @progbits
58 .LCUBegin:
59 .long .LCUEnd-.LCUVersion # Length of Unit
60 .LCUVersion:
61 .short 4 # Version
62 .long 0 # Abbrev offset
63 .byte 8 # Address size
64 .uleb128 1 # Abbrev [1] DW_TAG_compile_unit
65 .quad 0x1100002222222222 # DW_AT_GNU_dwo_id
66 .LCUEnd:
68 .section .debug_types.dwo, "e", @progbits
69 .LTUBegin:
70 .long .LTUEnd-.LTUVersion # Length of Unit
71 .LTUVersion:
72 .short 4 # Version
73 .long 0 # Abbrev offset
74 .byte 8 # Address size
75 .quad 0x1100003333333333 # Type signature
76 .long .LTUType-.LTUBegin # Type offset
77 .uleb128 1 # Abbrev [1] DW_TAG_type_unit
78 .LTUType:
79 .uleb128 2 # Abbrev [2] DW_TAG_structure_type
80 .LTUEnd:
82 .section .debug_cu_index, "", @progbits
83 ## Header:
84 .long 2 # Version
85 .long 4 # Section count
86 .long 1 # Unit count
87 .long 2 # Slot count
88 ## Hash Table of Signatures:
89 .quad 0x1100002222222222
90 .quad 0
91 ## Parallel Table of Indexes:
92 .long 1
93 .long 0
94 ## Table of Section Offsets:
95 ## Row 0:
96 .long 1 # DW_SECT_INFO
97 .long 3 # DW_SECT_ABBREV
98 .long 0 # Invalid ID, less than DW_SECT_INFO
99 .long 9 # Invalid ID, greater than DW_SECT_MACRO
100 ## Row 1:
101 .long 0 # Offset in .debug_info.dwo
102 .long 0 # Offset in .debug_abbrev.dwo
103 .long 0
104 .long 0
105 ## Table of Section Sizes:
106 .long .LCUEnd-.LCUBegin # Size in .debug_info.dwo
107 .long .LCUAbbrevEnd-.LCUAbbrevBegin # Size in .debug_abbrev.dwo
108 .long 1
109 .long 1
111 .section .debug_tu_index, "", @progbits
112 ## Header:
113 .long 2 # Version
114 .long 4 # Section count
115 .long 1 # Unit count
116 .long 2 # Slot count
117 ## Hash Table of Signatures:
118 .quad 0
119 .quad 0x1100003333333333
120 ## Parallel Table of Indexes:
121 .long 0
122 .long 1
123 ## Table of Section Offsets:
124 ## Row 0:
125 .long 2 # DW_SECT_TYPES
126 .long 3 # DW_SECT_ABBREV
127 .long 0 # Invalid ID, less than DW_SECT_INFO
128 .long 9 # Invalid ID, greater than DW_SECT_MACRO
129 ## Row 1:
130 .long 0 # Offset in .debug_types.dwo
131 .long .LTUAbbrevBegin-.debug_abbrev.dwo # Offset in .debug_abbrev.dwo
132 .long 0
133 .long 0
134 ## Table of Section Sizes:
135 .long .LTUEnd-.LTUBegin # Size in .debug_types.dwo
136 .long .LTUAbbrevEnd-.LTUAbbrevBegin # Size in .debug_abbrev.dwo
137 .long 1
138 .long 1