blob: 08df374f2fc95c2ce0b654ecc58ac79b4473d720 [file] [log] [blame]
Reid Klecknerb78257d2014-02-03 18:54:51 +00001// RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 -fno-rtti -mconstructor-aliases -O1 -disable-llvm-optzns | FileCheck %s
Rafael Espindola5fb3a132013-11-06 19:18:55 +00002
3namespace test1 {
4template <typename T> class A {
5 ~A() {}
6};
7template class A<char>;
Reid Klecknerb78257d2014-02-03 18:54:51 +00008// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$A@D@test1@@AAE@XZ"
9}
10
11namespace test2 {
12struct A {
13 virtual ~A();
14};
15struct B : A {
16 B();
17 virtual ~B();
18};
19
20A::~A() {}
21B::~B() {}
22void foo() {
23 B b;
24}
David Blaikiefc473552015-09-11 03:22:18 +000025// CHECK-DAG: @"\01??1B@test2@@UAE@XZ" = alias void (%"struct.test2::B"*), bitcast (void (%"struct.test2::A"*)* @"\01??1A@test2@@UAE@XZ" to void (%"struct.test2::B"*)*)
Rafael Espindola5fb3a132013-11-06 19:18:55 +000026}
Reid Kleckner489cfe12015-11-10 22:23:58 +000027
28namespace test3 {
29struct A { virtual ~A(); };
30A::~A() {}
31}
32// CHECK-DAG: define x86_thiscallcc void @"\01??1A@test3@@UAE@XZ"(
33namespace test3 {
34template <typename T>
35struct B : A {
36 virtual ~B() { }
37};
38template struct B<int>;
39}
40// This has to be weak, and emitting weak aliases is fragile, so we don't do the
41// aliasing.
42// CHECK-DAG: define weak_odr x86_thiscallcc void @"\01??1?$B@H@test3@@UAE@XZ"(