summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/virtual-base-destructor-call.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-02-18 19:59:28 +0000
committerJohn McCall <rjmccall@apple.com>2010-02-18 19:59:28 +0000
commit3b47733ceac33306bd54ce9d6c7d8eeeae52c7ca (patch)
tree209136255422a9ba0521b6945c8763c1fc987b7b /test/CodeGenCXX/virtual-base-destructor-call.cpp
parent4c58923ca904733d588ddb1cec58549b6bc7dfa9 (diff)
Make deleting and complete dtor variants defer to other dtor variants by
calling them as subroutines. This triggers whenever the alias optimization doesn't, i.e. when the dtor has linkonce linkage or there are virtual bases or it's the deleting dtor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/virtual-base-destructor-call.cpp')
-rw-r--r--test/CodeGenCXX/virtual-base-destructor-call.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/test/CodeGenCXX/virtual-base-destructor-call.cpp b/test/CodeGenCXX/virtual-base-destructor-call.cpp
index 1ee598afdc..b6e85e208b 100644
--- a/test/CodeGenCXX/virtual-base-destructor-call.cpp
+++ b/test/CodeGenCXX/virtual-base-destructor-call.cpp
@@ -16,4 +16,36 @@ basic_iostream<char> res;
int main() {
}
-// CHECK: call void @_ZN9basic_iosD2Ev
+// basic_iostream's complete dtor calls its base dtor, then its
+// virtual base's dtor.
+// CHECK: define linkonce_odr void @_ZN14basic_iostreamIcED1Ev
+// CHECK: call void @_ZN14basic_iostreamIcED2Ev
+// CHECK: call void @_ZN9basic_iosD2Ev
+
+// basic_iostream's deleting dtor calls its complete dtor, then
+// operator delete().
+// CHECK: define linkonce_odr void @_ZN14basic_iostreamIcED0Ev
+// CHECK: call void @_ZN14basic_iostreamIcED1Ev
+// CHECK: call void @_ZdlPv
+
+// basic_istream's complete dtor calls the base dtor,
+// then its virtual base's base dtor.
+// CHECK: define linkonce_odr void @_ZN13basic_istreamIcED1Ev
+// CHECK: call void @_ZN13basic_istreamIcED2Ev
+// CHECK: call void @_ZN9basic_iosD2Ev
+
+// basic_istream's deleting dtor calls the complete dtor, then
+// operator delete().
+// CHECK: define linkonce_odr void @_ZN13basic_istreamIcED0Ev
+// CHECK: call void @_ZN13basic_istreamIcED1Ev
+// CHECK: call void @_ZdlPv
+
+// basic_iostream's base dtor calls its non-virtual base dtor.
+// CHECK: define linkonce_odr void @_ZN14basic_iostreamIcED2Ev
+// CHECK: call void @_ZN13basic_istreamIcED2Ev
+// CHECK: }
+
+// basic_istream's base dtor is a no-op.
+// CHECK: define linkonce_odr void @_ZN13basic_istreamIcED2Ev
+// CHECK-NOT: call
+// CHECK: }