[RISCV] Add shrinkwrap test cases showing gaps in current impl
[llvm-project.git] / clang / test / CodeGenCXX / virtual-base-destructor-call.cpp
blob7633d29e82cfd4e31f71ce406d61f8ea4055e43d
1 // RUN: %clang_cc1 %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
3 struct basic_ios{~basic_ios(); };
5 template<typename _CharT> struct basic_istream : virtual public basic_ios {
6 virtual ~basic_istream(){}
7 };
9 template<typename _CharT> struct basic_iostream : public basic_istream<_CharT>
11 virtual ~basic_iostream(){}
14 basic_iostream<char> res;
16 int main() {
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
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
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
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
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: }
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: }