2 # RUN: llvm-mc -triple=i686-windows-gnu -filetype=obj -o %t.o %s
3 # RUN: cp %t.o %t.dupl.o
4 # RUN: not lld-link -lldmingw -out:%t.exe %t.o %t.dupl.o -entry:_Z4funcv 2>&1 | FileCheck %s
6 # CHECK: error: duplicate symbol: func()
7 # CHECK-NEXT: >>> defined at /path/to/src{{[/\\]}}dupl.cpp:6
8 # CHECK-NEXT: >>> {{.*}}.o
9 # CHECK-NEXT: >>> defined at /path/to/src{{[/\\]}}dupl.cpp:6
10 # CHECK-NEXT: >>> {{.*}}.o
12 # CHECK-NEXT: error: duplicate symbol: _var
13 # CHECK-NEXT: >>> defined at /path/to/src{{[/\\]}}dupl.cpp:1
14 # CHECK-NEXT: >>> {{.*}}.o
15 # CHECK-NEXT: >>> defined at /path/to/src{{[/\\]}}dupl.cpp:1
16 # CHECK-NEXT: >>> {{.*}}.o
18 # CHECK-NEXT: error: duplicate symbol: A::namespaceVar
19 # CHECK-NEXT: >>> defined at /path/to/src{{[/\\]}}dupl.cpp:3
20 # CHECK-NEXT: >>> {{.*}}.o
21 # CHECK-NEXT: >>> defined at /path/to/src{{[/\\]}}dupl.cpp:3
22 # CHECK-NEXT: >>> {{.*}}.o
26 .file 1 "/path/to/src" "dupl.cpp"
28 .globl __Z4funcv # -- Begin function _Z4funcv
29 __Z4funcv
: # @_Z4funcv
31 .loc 1 5 0 # dupl.cpp:5:0
33 .loc 1 6 1 prologue_end # dupl.cpp:6:1
42 .globl __ZN1A12namespaceVarE # @_ZN1A12namespaceVarE
43 __ZN1A12namespaceVarE
:
46 .section .debug_str,"dr"
57 .asciz "_ZN1A12namespaceVarE"
62 .section .debug_abbrev,"dr"
64 .byte 1 # Abbreviation Code
65 .byte 17 # DW_TAG_compile_unit
66 .byte 1 # DW_CHILDREN_yes
67 .byte 37 # DW_AT_producer
68 .byte 37 # DW_FORM_strx1
69 .byte 19 # DW_AT_language
70 .byte 5 # DW_FORM_data2
72 .byte 37 # DW_FORM_strx1
73 .byte 16 # DW_AT_stmt_list
74 .byte 23 # DW_FORM_sec_offset
75 .byte 17 # DW_AT_low_pc
76 .byte 1 # DW_FORM_addr
77 .byte 18 # DW_AT_high_pc
78 .byte 6 # DW_FORM_data4
81 .byte 2 # Abbreviation Code
82 .byte 52 # DW_TAG_variable
83 .byte 0 # DW_CHILDREN_no
85 .byte 14 # DW_FORM_strp
87 .byte 19 # DW_FORM_ref4
88 .byte 63 # DW_AT_external
89 .byte 25 # DW_FORM_flag_present
90 .byte 58 # DW_AT_decl_file
91 .byte 11 # DW_FORM_data1
92 .byte 59 # DW_AT_decl_line
93 .byte 11 # DW_FORM_data1
94 .byte 2 # DW_AT_location
95 .byte 24 # DW_FORM_exprloc
98 .byte 3 # Abbreviation Code
99 .byte 36 # DW_TAG_base_type
100 .byte 0 # DW_CHILDREN_no
102 .byte 14 # DW_FORM_strp
103 .byte 62 # DW_AT_encoding
104 .byte 11 # DW_FORM_data1
105 .byte 11 # DW_AT_byte_size
106 .byte 11 # DW_FORM_data1
109 .byte 4 # Abbreviation Code
110 .byte 57 # DW_TAG_namespace
111 .byte 1 # DW_CHILDREN_yes
113 .byte 14 # DW_FORM_strp
116 .byte 5 # Abbreviation Code
117 .byte 52 # DW_TAG_variable
118 .byte 0 # DW_CHILDREN_no
120 .byte 14 # DW_FORM_strp
121 .byte 73 # DW_AT_type
122 .byte 19 # DW_FORM_ref4
123 .byte 63 # DW_AT_external
124 .byte 25 # DW_FORM_flag_present
125 .byte 58 # DW_AT_decl_file
126 .byte 11 # DW_FORM_data1
127 .byte 59 # DW_AT_decl_line
128 .byte 11 # DW_FORM_data1
129 .byte 2 # DW_AT_location
130 .byte 24 # DW_FORM_exprloc
131 .byte 110 # DW_AT_linkage_name
132 .byte 14 # DW_FORM_strp
135 .byte 6 # Abbreviation Code
136 .byte 46 # DW_TAG_subprogram
137 .byte 0 # DW_CHILDREN_no
138 .byte 17 # DW_AT_low_pc
139 .byte 1 # DW_FORM_addr
140 .byte 18 # DW_AT_high_pc
141 .byte 6 # DW_FORM_data4
142 .byte 64 # DW_AT_frame_base
143 .byte 24 # DW_FORM_exprloc
144 .byte 110 # DW_AT_linkage_name
145 .byte 14 # DW_FORM_strp
147 .byte 14 # DW_FORM_strp
148 .byte 58 # DW_AT_decl_file
149 .byte 11 # DW_FORM_data1
150 .byte 59 # DW_AT_decl_line
151 .byte 11 # DW_FORM_data1
152 .byte 63 # DW_AT_external
153 .byte 25 # DW_FORM_flag_present
157 .section .debug_info,"dr"
160 .long Ldebug_info_end0-Ldebug_info_start0 # Length of Unit
162 .short 4 # DWARF version number
163 .secrel32 Lsection_abbrev # Offset Into Abbrev. Section
164 .byte 4 # Address Size (in bytes)
165 .byte 1 # Abbrev [1] 0xb:0x64 DW_TAG_compile_unit
166 .byte 0 # DW_AT_producer
167 .short 33 # DW_AT_language
169 .secrel32 Lline_table_start0 # DW_AT_stmt_list
170 .long Lfunc_begin0 # DW_AT_low_pc
171 .long Lfunc_end0-Lfunc_begin0 # DW_AT_high_pc
172 .byte 2 # Abbrev [2] 0x26:0x11 DW_TAG_variable
173 .secrel32 Linfo_string0 # DW_AT_name
174 .secrel32 Linfo_type_int # DW_AT_type
176 .byte 1 # DW_AT_decl_file
177 .byte 1 # DW_AT_decl_line
178 .byte 5 # DW_AT_location
182 .byte 3 # Abbrev [3] 0x37:0x7 DW_TAG_base_type
183 .secrel32 Linfo_string1 # DW_AT_name
184 .byte 5 # DW_AT_encoding
185 .byte 4 # DW_AT_byte_size
186 .byte 4 # Abbrev [4] 0x3e:0x1b DW_TAG_namespace
187 .secrel32 Linfo_string2 # DW_AT_name
188 .byte 5 # Abbrev [5] 0x43:0x15 DW_TAG_variable
189 .secrel32 Linfo_string3 # DW_AT_name
190 .secrel32 Linfo_type_int # DW_AT_type
192 .byte 1 # DW_AT_decl_file
193 .byte 3 # DW_AT_decl_line
194 .byte 5 # DW_AT_location
196 .long __ZN1A12namespaceVarE
197 .secrel32 Linfo_string4 # DW_AT_linkage_name
198 .byte 0 # End Of Children Mark
199 .byte 6 # Abbrev [6] 0x59:0x15 DW_TAG_subprogram
200 .long Lfunc_begin0 # DW_AT_low_pc
201 .long Lfunc_end0-Lfunc_begin0 # DW_AT_high_pc
202 .byte 1 # DW_AT_frame_base
204 .secrel32 Linfo_string5 # DW_AT_linkage_name
205 .secrel32 Linfo_string6 # DW_AT_name
206 .byte 1 # DW_AT_decl_file
207 .byte 5 # DW_AT_decl_line
209 .byte 0 # End Of Children Mark
212 .section .debug_line,"dr"