1
- // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o %t
1
+ // RUN: %clang_cc1 %s -triple=x86_64-pc-linux -emit-llvm -o %t
2
2
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -disable-llvm-optzns -O3 -emit-llvm -o %t.opt
3
3
// RUN: FileCheck --check-prefix=CHECK %s < %t
4
4
// RUN: FileCheck --check-prefix=CHECK-OPT %s < %t.opt
@@ -89,10 +89,10 @@ void use_F() {
89
89
90
90
// C has no key function, so its vtable should have weak_odr linkage
91
91
// and hidden visibility (rdar://problem/7523229).
92
- // CHECK-DAG: @_ZTV1C = linkonce_odr unnamed_addr constant
93
- // CHECK-DAG: @_ZTS1C = linkonce_odr constant
94
- // CHECK-DAG: @_ZTI1C = linkonce_odr constant
95
- // CHECK-DAG: @_ZTT1C = linkonce_odr unnamed_addr constant
92
+ // CHECK-DAG: @_ZTV1C = linkonce_odr unnamed_addr constant {{.*}}, comdat,
93
+ // CHECK-DAG: @_ZTS1C = linkonce_odr constant {{.*}}, comdat{{$}}
94
+ // CHECK-DAG: @_ZTI1C = linkonce_odr constant {{.*}}, comdat{{$}}
95
+ // CHECK-DAG: @_ZTT1C = linkonce_odr unnamed_addr constant {{.*}}, comdat{{$}}
96
96
97
97
// D has a key function that is defined in this translation unit so its vtable is
98
98
// defined in the translation unit.
@@ -110,28 +110,28 @@ void use_F() {
110
110
// E<short> is an explicit template instantiation with a key function
111
111
// defined in this translation unit, so its vtable should have
112
112
// weak_odr linkage.
113
- // CHECK-DAG: @_ZTV1EIsE = weak_odr unnamed_addr constant
114
- // CHECK-DAG: @_ZTS1EIsE = weak_odr constant
115
- // CHECK-DAG: @_ZTI1EIsE = weak_odr constant
113
+ // CHECK-DAG: @_ZTV1EIsE = weak_odr unnamed_addr constant {{.*}}, comdat,
114
+ // CHECK-DAG: @_ZTS1EIsE = weak_odr constant {{.*}}, comdat{{$}}
115
+ // CHECK-DAG: @_ZTI1EIsE = weak_odr constant {{.*}}, comdat{{$}}
116
116
117
117
// F<short> is an explicit template instantiation without a key
118
118
// function, so its vtable should have weak_odr linkage
119
- // CHECK-DAG: @_ZTV1FIsE = weak_odr unnamed_addr constant
120
- // CHECK-DAG: @_ZTS1FIsE = weak_odr constant
121
- // CHECK-DAG: @_ZTI1FIsE = weak_odr constant
119
+ // CHECK-DAG: @_ZTV1FIsE = weak_odr unnamed_addr constant {{.*}}, comdat,
120
+ // CHECK-DAG: @_ZTS1FIsE = weak_odr constant {{.*}}, comdat{{$}}
121
+ // CHECK-DAG: @_ZTI1FIsE = weak_odr constant {{.*}}, comdat{{$}}
122
122
123
123
// E<long> is an implicit template instantiation with a key function
124
124
// defined in this translation unit, so its vtable should have
125
125
// linkonce_odr linkage.
126
- // CHECK-DAG: @_ZTV1EIlE = linkonce_odr unnamed_addr constant
127
- // CHECK-DAG: @_ZTS1EIlE = linkonce_odr constant
128
- // CHECK-DAG: @_ZTI1EIlE = linkonce_odr constant
126
+ // CHECK-DAG: @_ZTV1EIlE = linkonce_odr unnamed_addr constant {{.*}}, comdat,
127
+ // CHECK-DAG: @_ZTS1EIlE = linkonce_odr constant {{.*}}, comdat{{$}}
128
+ // CHECK-DAG: @_ZTI1EIlE = linkonce_odr constant {{.*}}, comdat{{$}}
129
129
130
130
// F<long> is an implicit template instantiation with no key function,
131
131
// so its vtable should have linkonce_odr linkage.
132
- // CHECK-DAG: @_ZTV1FIlE = linkonce_odr unnamed_addr constant
133
- // CHECK-DAG: @_ZTS1FIlE = linkonce_odr constant
134
- // CHECK-DAG: @_ZTI1FIlE = linkonce_odr constant
132
+ // CHECK-DAG: @_ZTV1FIlE = linkonce_odr unnamed_addr constant {{.*}}, comdat,
133
+ // CHECK-DAG: @_ZTS1FIlE = linkonce_odr constant {{.*}}, comdat{{$}}
134
+ // CHECK-DAG: @_ZTI1FIlE = linkonce_odr constant {{.*}}, comdat{{$}}
135
135
136
136
// F<int> is an explicit template instantiation declaration without a
137
137
// key function, so its vtable should have external linkage.
@@ -158,11 +158,11 @@ void use_F() {
158
158
159
159
// F<char> is an explicit specialization without a key function, so
160
160
// its vtable should have linkonce_odr linkage.
161
- // CHECK-DAG: @_ZTV1FIcE = linkonce_odr unnamed_addr constant
162
- // CHECK-DAG: @_ZTS1FIcE = linkonce_odr constant
163
- // CHECK-DAG: @_ZTI1FIcE = linkonce_odr constant
161
+ // CHECK-DAG: @_ZTV1FIcE = linkonce_odr unnamed_addr constant {{.*}}, comdat,
162
+ // CHECK-DAG: @_ZTS1FIcE = linkonce_odr constant {{.*}}, comdat{{$}}
163
+ // CHECK-DAG: @_ZTI1FIcE = linkonce_odr constant {{.*}}, comdat{{$}}
164
164
165
- // CHECK-DAG: @_ZTV1GIiE = linkonce_odr unnamed_addr constant
165
+ // CHECK-DAG: @_ZTV1GIiE = linkonce_odr unnamed_addr constant {{.*}}, comdat,
166
166
template <typename T>
167
167
class G {
168
168
public:
@@ -178,7 +178,7 @@ void G_f0() { new G<int>(); }
178
178
179
179
// H<int> has a key function without a body but it's a template instantiation
180
180
// so its VTable must be emitted.
181
- // CHECK-DAG: @_ZTV1HIiE = linkonce_odr unnamed_addr constant
181
+ // CHECK-DAG: @_ZTV1HIiE = linkonce_odr unnamed_addr constant {{.*}}, comdat,
182
182
template <typename T>
183
183
class H {
184
184
public:
0 commit comments