]> granicus.if.org Git - clang/commitdiff
Add a testcase where we replace a destructor with an alias.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 11 Nov 2013 22:55:13 +0000 (22:55 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 11 Nov 2013 22:55:13 +0000 (22:55 +0000)
This is a reduced testcase from a cast to Function failing during bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194430 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGenCXX/ctor-dtor-alias.cpp

index 1ab66a04d0d60baed749b86f1b7a735de7c72418..ef56564d3dd82234fe28d25697eac2f0f8155306 100644 (file)
@@ -103,3 +103,19 @@ namespace test7 {
   template class A<int>;
   B::~B() {}
 }
+
+namespace test8 {
+  // Test that we replace ~zed with ~bar which is an alias to ~foo.
+  // CHECK-DAG: call i32 @__cxa_atexit({{.*}}@_ZN5test83barD2Ev
+  // CHECK-DAG: @_ZN5test83barD2Ev = alias {{.*}} @_ZN5test83fooD2Ev
+  struct foo {
+    ~foo();
+  };
+  foo::~foo() {}
+  struct bar : public foo {
+    ~bar();
+  };
+  bar::~bar() {}
+  struct zed : public bar {};
+  zed foo;
+}