From: Rafael Espindola Date: Mon, 11 Nov 2013 22:55:13 +0000 (+0000) Subject: Add a testcase where we replace a destructor with an alias. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=964bfa1f2075a318ea0438f9ae3df6c4d4e923a9;p=clang Add a testcase where we replace a destructor with an alias. 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 --- diff --git a/test/CodeGenCXX/ctor-dtor-alias.cpp b/test/CodeGenCXX/ctor-dtor-alias.cpp index 1ab66a04d0..ef56564d3d 100644 --- a/test/CodeGenCXX/ctor-dtor-alias.cpp +++ b/test/CodeGenCXX/ctor-dtor-alias.cpp @@ -103,3 +103,19 @@ namespace test7 { template class A; 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; +}