xref: /llvm-project/llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/odr-namespace-extension.test (revision f1fdfe6888f93b9f6dfb4689e1f3206de584ff5b)
1# RUN: yaml2obj %s -o %t.o
2# RUN: echo '---' > %t2.map
3# RUN: echo "triple:          'x86_64-apple-darwin'" >> %t2.map
4# RUN: echo 'objects:'  >> %t2.map
5# RUN: echo " -  filename: '%t.o'" >> %t2.map
6# RUN: echo '    symbols:' >> %t2.map
7# RUN: echo '      - { sym: __Z3foov, objAddr: 0x0, binAddr: 0x10000, size: 0x10 }' >> %t2.map
8# RUN: echo '...' >> %t2.map
9# RUN: dsymutil --linker=parallel -y %t2.map -f -o %t1.out
10# RUN: llvm-dwarfdump -a %t1.out | FileCheck %s
11
12## This test checks that DW_TAG_namespace with DW_AT_extension
13## attribute is joined with referenced namespace.
14
15# CHECK: file format Mach-O 64-bit x86-64
16# CHECK: 0x0000000b: DW_TAG_compile_unit
17# CHECK: DW_TAG_namespace
18# CHECK: DW_AT_name{{.*}}"parent_namespace"
19# CHECK-NOT: DW_TAG_namespace
20# CHECK: 0x[[INT:[0-9a-f]*]]: DW_TAG_base_type
21# CHECK: DW_AT_name{{.*}}"int"
22# CHECK: DW_TAG_compile_unit
23# CHECK: DW_TAG_variable
24# CHECK: DW_AT_type      (0x00000000[[INT]]
25
26--- !mach-o
27FileHeader:
28  magic:      0xFEEDFACF
29  cputype:    0x01000007
30  cpusubtype: 0x00000003
31  filetype:   0x00000001
32  ncmds:      2
33  sizeofcmds: 376
34  flags:      0x00002000
35  reserved:   0x00000000
36LoadCommands:
37  - cmd:      LC_SEGMENT_64
38    cmdsize:  232
39    segname:  ''
40    vmaddr:   0x00
41    vmsize:   0x300
42    fileoff:  0x300
43    filesize: 0x300
44    maxprot:  7
45    initprot: 7
46    nsects:   2
47    flags:    0
48    Sections:
49      - sectname:  __debug_abbrev
50        segname:   __DWARF
51        addr:      0x000000000000000F
52        size:      0x2A
53        offset:    0x00000380
54        align:     0
55        reloff:    0x00000000
56        nreloc:    0
57        flags:     0x02000000
58        reserved1: 0x00000000
59        reserved2: 0x00000000
60        reserved3: 0x00000000
61      - sectname:  __debug_info
62        segname:   __DWARF
63        addr:      0x000000000000100
64        size:      0x42
65        offset:    0x000003AA
66        align:     0
67        reloff:    0x00000600
68        nreloc:    1
69        flags:     0x02000000
70        reserved1: 0x00000000
71        reserved2: 0x00000000
72        reserved3: 0x00000000
73        relocations:
74          - address:         0x000001FC
75            symbolnum:       1
76            pcrel:           true
77            length:          3
78            extern:          false
79            type:            0
80            scattered:       false
81            value:           0
82  - cmd:             LC_SYMTAB
83    cmdsize:         24
84    symoff:          0x700
85    nsyms:           1
86    stroff:          0x710
87    strsize:         10
88LinkEditData:
89  NameList:
90    - n_strx:          1
91      n_type:          0x0F
92      n_sect:          1
93      n_desc:          0
94      n_value:         0
95  StringTable:
96    - ''
97    - '__Z3foov'
98    - ''
99DWARF:
100  debug_abbrev:
101    - Table:
102      - Tag:      DW_TAG_compile_unit
103        Children: DW_CHILDREN_yes
104        Attributes:
105          - Attribute: DW_AT_producer
106            Form:      DW_FORM_string
107          - Attribute: DW_AT_language
108            Form:      DW_FORM_data2
109      - Tag:      DW_TAG_namespace
110        Children: DW_CHILDREN_yes
111        Attributes:
112          - Attribute: DW_AT_name
113            Form:      DW_FORM_string
114      - Tag:      DW_TAG_namespace
115        Children: DW_CHILDREN_yes
116        Attributes:
117          - Attribute: DW_AT_extension
118            Form:      DW_FORM_ref_addr
119      - Tag:      DW_TAG_base_type
120        Children: DW_CHILDREN_no
121        Attributes:
122          - Attribute: DW_AT_name
123            Form:      DW_FORM_string
124      - Tag:      DW_TAG_variable
125        Children: DW_CHILDREN_no
126        Attributes:
127          - Attribute: DW_AT_name
128            Form:      DW_FORM_string
129          - Attribute: DW_AT_const_value
130            Form:      DW_FORM_data4
131          - Attribute: DW_AT_type
132            Form:      DW_FORM_ref_addr
133  debug_info:
134    - Version: 4
135      Entries:
136        - AbbrCode: 1
137          Values:
138            - CStr: by_hand
139            - Value:  0x04
140        - AbbrCode: 2
141          Values:
142            - CStr: parent_namespace
143        - AbbrCode: 3
144          Values:
145            - Value:  0x00000016
146        - AbbrCode: 4
147          Values:
148            - CStr: int
149        - AbbrCode: 0
150        - AbbrCode: 0
151        - AbbrCode: 5
152          Values:
153            - CStr: var
154            - Value:  0x000000FF
155            - Value:  0x0000002d
156        - AbbrCode: 0
157...
158