summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/destructors.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-09 16:13:15 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-09 16:13:15 +0000
commita25c79e7045fa1d92e9777a3dce8902a7963eb4c (patch)
tree07108fc24c7cc5934e1ea3143b4465c99b326201 /clang/test/CodeGenCXX/destructors.cpp
parentee863cedc29d45c1976fcd3b9f0a5bce34097238 (diff)
downloadbcm5719-llvm-a25c79e7045fa1d92e9777a3dce8902a7963eb4c.tar.gz
bcm5719-llvm-a25c79e7045fa1d92e9777a3dce8902a7963eb4c.zip
Use aliases for more constructors and destructors.
With this patch we produce alias for cases like template<typename T> struct foobar { foobar() { } }; template struct foobar<void>; It is safe to use aliases to weak symbols, as long and the alias itself is also weak. llvm-svn: 192300
Diffstat (limited to 'clang/test/CodeGenCXX/destructors.cpp')
-rw-r--r--clang/test/CodeGenCXX/destructors.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/destructors.cpp b/clang/test/CodeGenCXX/destructors.cpp
index f2c6f212ad6..0be188b29c7 100644
--- a/clang/test/CodeGenCXX/destructors.cpp
+++ b/clang/test/CodeGenCXX/destructors.cpp
@@ -6,10 +6,16 @@
// CHECK: @_ZN5test11OD2Ev = alias {{.*}} @_ZN5test11AD2Ev
// CHECK: @_ZN5test11SD2Ev = alias bitcast {{.*}} @_ZN5test11AD2Ev
+// CHECK: @_ZN6test106foobarIvEC1Ev = alias weak_odr void (%"struct.test10::foobar"*)* @_ZN6test106foobarIvEC2Ev
+
+// CHECK: @_ZN6test116foobarIvEC1Ev = alias linkonce_odr void (%"struct.test11::foobar"*)* @_ZN6test116foobarIvEC2Ev
+
// CHECK: @_ZN5test312_GLOBAL__N_11DD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11DD2Ev
// CHECK: @_ZN5test312_GLOBAL__N_11DD2Ev = alias internal bitcast {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
// CHECK: @_ZN5test312_GLOBAL__N_11CD1Ev = alias internal {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
+// CHECK: @_ZN6PR752617allocator_derivedD1Ev = alias linkonce_odr void (%"struct.PR7526::allocator_derived"*)* @_ZN6PR752617allocator_derivedD2Ev
+
struct A {
int a;
@@ -44,9 +50,6 @@ namespace PR7526 {
// CHECK: call void @__cxa_call_unexpected
allocator::~allocator() throw() { foo(); }
- // CHECK-LABEL: define linkonce_odr void @_ZN6PR752617allocator_derivedD1Ev(%"struct.PR7526::allocator_derived"* %this) unnamed_addr
- // CHECK-NOT: call void @__cxa_call_unexpected
- // CHECK: }
void foo() {
allocator_derived ad;
}
@@ -419,3 +422,25 @@ namespace test9 {
// CHECK: ret void
// CHECK: attributes [[NUW]] = {{[{].*}} nounwind {{.*[}]}}
+
+
+namespace test10 {
+ template<typename T>
+ struct foobar {
+ foobar() {
+ }
+ };
+
+ template struct foobar<void>;
+}
+
+namespace test11 {
+ void g();
+ template<typename T>
+ struct foobar {
+ foobar() {
+ g();
+ }
+ };
+ foobar<void> x;
+}
OpenPOWER on IntegriCloud