Follow up to d0858bffa11, add missing REQUIRES x86
[llvm-project.git] / llvm / test / tools / dsymutil / X86 / tls-variable.test
blob48027e4f98714dc56f614eccc901cecd7771c678
1 ## This test checks that thread local storage variables
2 ## are preserved.
4 # RUN: yaml2obj %s -o %t.o
5 # RUN: echo '---' > %t2.map
6 # RUN: echo "triple:          'x86_64-apple-darwin'" >> %t2.map
7 # RUN: echo 'objects:'  >> %t2.map
8 # RUN: echo " -  filename: '%t.o'" >> %t2.map
9 # RUN: echo '    symbols:' >> %t2.map
10 # RUN: echo '      - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map
11 # RUN: echo '...' >> %t2.map
12 # RUN: dsymutil -y %t2.map --keep-function-for-static -f -o - | llvm-dwarfdump -a - | FileCheck %s
13 # RUN: dsymutil --linker llvm -y %t2.map --keep-function-for-static -f -o - | llvm-dwarfdump -a - | FileCheck %s
15 # CHECK: file format Mach-O 64-bit x86-64
16 # CHECK: .debug_info contents:
17 # CHECK: Compile Unit:
18 # CHECK: DW_TAG_compile_unit
19 # CHECK: DW_AT_name{{.*}}"CU1"
20 # CHECK: DW_TAG_subprogram
21 # CHECK: DW_AT_name{{.*}}"foo"
22 # CHECK: DW_TAG_variable
23 # CHECK: DW_AT_name{{.*}}"var1"
24 # CHECK: DW_AT_location        (DW_OP_const8u 0x{{.*}}, DW_OP_GNU_push_tls_address)
25 # CHECK: DW_AT_name{{.*}}"var2"
26 # CHECK: DW_AT_location        (DW_OP_const8u 0x{{.*}}, DW_OP_form_tls_address)
28 --- !mach-o
29 FileHeader:
30   magic:      0xFEEDFACF
31   cputype:    0x01000007
32   cpusubtype: 0x00000003
33   filetype:   0x00000001
34   ncmds:      2
35   sizeofcmds: 376
36   flags:      0x00002000
37   reserved:   0x00000000
38 LoadCommands:
39   - cmd:      LC_SEGMENT_64
40     cmdsize:  232
41     segname:  ''
42     vmaddr:   0x00
43     vmsize:   0x300
44     fileoff:  0x300
45     filesize: 0x300
46     maxprot:  7
47     initprot: 7
48     nsects:   2
49     flags:    0
50     Sections:
51       - sectname:  __debug_abbrev
52         segname:   __DWARF
53         addr:      0x000000000000000F
54         size:      0x27
55         offset:    0x00000380
56         align:     0
57         reloff:    0x00000000
58         nreloc:    0
59         flags:     0x02000000
60         reserved1: 0x00000000
61         reserved2: 0x00000000
62         reserved3: 0x00000000
63       - sectname:  __debug_info
64         segname:   __DWARF
65         addr:      0x000000000000100
66         size:      0x54
67         offset:    0x00000410
68         align:     0
69         reloff:    0x00000600
70         nreloc:    2
71         flags:     0x02000000
72         reserved1: 0x00000000
73         reserved2: 0x00000000
74         reserved3: 0x00000000
75         relocations:
76           - address:         0x32
77             symbolnum:       1
78             pcrel:           true
79             length:          3
80             extern:          true
81             type:            0
82             scattered:       false
83             value:           0
84           - address:         0x47
85             symbolnum:       1
86             pcrel:           true
87             length:          3
88             extern:          true
89             type:            0
90             scattered:       false
91             value:           0
92   - cmd:             LC_SYMTAB
93     cmdsize:         24
94     symoff:          0x700
95     nsyms:           2
96     stroff:          0x720
97     strsize:         10
98 LinkEditData:
99   NameList:
100     - n_strx:          1
101       n_type:          0x0F
102       n_sect:          1
103       n_desc:          0
104       n_value:         0
105     - n_strx:          1
106       n_type:          0x0F
107       n_sect:          1
108       n_desc:          0
109       n_value:         0
110   StringTable:
111     - ''
112     - '__Z3foov'
113     - ''
114 DWARF:
115   debug_abbrev:
116     - Table:
117       - Tag:      DW_TAG_compile_unit
118         Children: DW_CHILDREN_yes
119         Attributes:
120           - Attribute: DW_AT_producer
121             Form:      DW_FORM_string
122           - Attribute: DW_AT_language
123             Form:      DW_FORM_data2
124           - Attribute: DW_AT_name
125             Form:      DW_FORM_string
126       - Tag:      DW_TAG_subprogram
127         Children: DW_CHILDREN_yes
128         Attributes:
129           - Attribute: DW_AT_name
130             Form:      DW_FORM_string
131           - Attribute: DW_AT_type
132             Form:      DW_FORM_ref4
133       - Tag:      DW_TAG_variable
134         Children: DW_CHILDREN_no
135         Attributes:
136           - Attribute: DW_AT_name
137             Form:      DW_FORM_string
138           - Attribute: DW_AT_type
139             Form:      DW_FORM_ref4
140           - Attribute: DW_AT_location
141             Form:      DW_FORM_exprloc
142       - Tag:      DW_TAG_base_type
143         Children: DW_CHILDREN_no
144         Attributes:
145           - Attribute: DW_AT_name
146             Form:      DW_FORM_string
147   debug_info:
148     - Version: 4
149       Entries:
150         - AbbrCode: 1
151           Values:
152             - CStr: by_hand
153             - Value:  0x04
154             - CStr: CU1
155         - AbbrCode: 4
156           Values:
157             - CStr: int
158         - AbbrCode: 2
159           Values:
160             - CStr: foo
161             - Value: 0x1a
162         - AbbrCode: 3
163           Values:
164             - CStr: var1
165             - Value:  0x0000001a
166             - BlockData:
167                 - 0x0e
168                 - 0x00
169                 - 0x00
170                 - 0x01
171                 - 0x00
172                 - 0x00
173                 - 0x00
174                 - 0x00
175                 - 0x00
176                 - 0xe0
177         - AbbrCode: 3
178           Values:
179             - CStr: var2
180             - Value:  0x0000001a
181             - BlockData:
182                 - 0x0e
183                 - 0x00
184                 - 0x00
185                 - 0x01
186                 - 0x00
187                 - 0x00
188                 - 0x00
189                 - 0x00
190                 - 0x00
191                 - 0x9b
192         - AbbrCode: 0
193         - AbbrCode: 0