2010-02-19 09:32:20 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=x86_64-apple-darwin10 -mconstructor-aliases | FileCheck %s
|
2009-12-05 03:33:17 +08:00
|
|
|
|
2010-02-23 08:48:20 +08:00
|
|
|
struct Member {
|
|
|
|
~Member();
|
|
|
|
};
|
|
|
|
|
2009-12-05 03:33:17 +08:00
|
|
|
struct A {
|
|
|
|
virtual ~A();
|
|
|
|
};
|
|
|
|
|
|
|
|
struct B : A {
|
2010-02-23 08:48:20 +08:00
|
|
|
Member m;
|
2009-12-05 03:33:17 +08:00
|
|
|
virtual ~B();
|
|
|
|
};
|
|
|
|
|
2010-02-19 09:32:20 +08:00
|
|
|
// Complete dtor: just an alias because there are no virtual bases.
|
|
|
|
// CHECK: @_ZN1BD1Ev = alias {{.*}} @_ZN1BD2Ev
|
2010-01-02 09:01:18 +08:00
|
|
|
|
2010-02-23 08:48:20 +08:00
|
|
|
// (aliases from C)
|
|
|
|
// CHECK: @_ZN1CD1Ev = alias {{.*}} @_ZN1CD2Ev
|
|
|
|
// CHECK: @_ZN1CD2Ev = alias bitcast {{.*}} @_ZN1BD2Ev
|
|
|
|
|
2010-02-19 03:59:28 +08:00
|
|
|
// Deleting dtor: defers to the complete dtor.
|
2009-12-05 03:33:17 +08:00
|
|
|
// CHECK: define void @_ZN1BD0Ev
|
2010-02-19 03:59:28 +08:00
|
|
|
// CHECK: call void @_ZN1BD1Ev
|
|
|
|
// CHECK: call void @_ZdlPv
|
2009-12-05 03:33:17 +08:00
|
|
|
|
2010-02-19 03:59:28 +08:00
|
|
|
// Base dtor: actually calls A's base dtor.
|
2009-12-05 03:33:17 +08:00
|
|
|
// CHECK: define void @_ZN1BD2Ev
|
2010-02-23 08:48:20 +08:00
|
|
|
// CHECK: call void @_ZN6MemberD1Ev
|
2009-12-05 03:33:17 +08:00
|
|
|
// CHECK: call void @_ZN1AD2Ev
|
|
|
|
|
|
|
|
B::~B() { }
|
2010-02-23 08:48:20 +08:00
|
|
|
|
|
|
|
struct C : B {
|
|
|
|
~C();
|
|
|
|
};
|
|
|
|
|
|
|
|
C::~C() { }
|
|
|
|
|
|
|
|
// Complete dtor: just an alias (checked above).
|
|
|
|
|
|
|
|
// Deleting dtor: defers to the complete dtor.
|
|
|
|
// CHECK: define void @_ZN1CD0Ev
|
|
|
|
// CHECK: call void @_ZN1CD1Ev
|
|
|
|
// CHECK: call void @_ZdlPv
|
|
|
|
|
|
|
|
// Base dtor: just an alias to B's base dtor.
|