| 1 |
// RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s |
| 2 |
|
| 3 |
struct basic_ios{~basic_ios(); }; |
| 4 |
|
| 5 |
template<typename _CharT> struct basic_istream : virtual public basic_ios { |
| 6 |
virtual ~basic_istream(){} |
| 7 |
}; |
| 8 |
|
| 9 |
template<typename _CharT> struct basic_iostream : public basic_istream<_CharT> |
| 10 |
{ |
| 11 |
virtual ~basic_iostream(){} |
| 12 |
}; |
| 13 |
|
| 14 |
basic_iostream<char> res; |
| 15 |
|
| 16 |
int main() { |
| 17 |
} |
| 18 |
|
| 19 |
// basic_iostream's complete dtor calls its base dtor, then its |
| 20 |
// virtual base's dtor. |
| 21 |
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED1Ev(ptr {{.*}}%this) unnamed_addr |
| 22 |
// CHECK: call {{.*}} @_ZN14basic_iostreamIcED2Ev |
| 23 |
// CHECK: call {{.*}} @_ZN9basic_iosD2Ev |
| 24 |
|
| 25 |
// basic_istream's complete dtor calls the base dtor, |
| 26 |
// then its virtual base's base dtor. |
| 27 |
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED1Ev(ptr {{.*}}%this) unnamed_addr |
| 28 |
// CHECK: call {{.*}} @_ZN13basic_istreamIcED2Ev |
| 29 |
// CHECK: call {{.*}} @_ZN9basic_iosD2Ev |
| 30 |
|
| 31 |
// basic_istream's deleting dtor calls the complete dtor, then |
| 32 |
// operator delete(). |
| 33 |
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED0Ev(ptr {{.*}}%this) unnamed_addr |
| 34 |
// CHECK: call {{.*}} @_ZN13basic_istreamIcED1Ev |
| 35 |
// CHECK: call {{.*}} @_ZdlPv |
| 36 |
|
| 37 |
// basic_iostream's deleting dtor calls its complete dtor, then |
| 38 |
// operator delete(). |
| 39 |
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED0Ev(ptr {{.*}}%this) unnamed_addr |
| 40 |
// CHECK: call {{.*}} @_ZN14basic_iostreamIcED1Ev |
| 41 |
// CHECK: call {{.*}} @_ZdlPv |
| 42 |
|
| 43 |
// basic_istream's base dtor is a no-op. |
| 44 |
// CHECK: define linkonce_odr {{.*}} @_ZN13basic_istreamIcED2Ev(ptr {{.*}}%this, ptr noundef %vtt) unnamed_addr |
| 45 |
// CHECK-NOT: call |
| 46 |
// CHECK: } |
| 47 |
|
| 48 |
// basic_iostream's base dtor calls its non-virtual base dtor. |
| 49 |
// CHECK: define linkonce_odr {{.*}} @_ZN14basic_iostreamIcED2Ev(ptr {{.*}}%this, ptr noundef %vtt) unnamed_addr |
| 50 |
// CHECK: call {{.*}} @_ZN13basic_istreamIcED2Ev |
| 51 |
// CHECK: } |