summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.oliva/delete4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.oliva/delete4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/delete4.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete4.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete4.C
new file mode 100644
index 000000000..83084a173
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/delete4.C
@@ -0,0 +1,30 @@
+// { dg-do run }
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+// Test whether dtors of vbases are called from dtor of aggregate of array.
+// Variant of delete2.C and delete3.C.
+
+extern "C" void abort();
+extern "C" void exit(int);
+
+struct Foo {
+ ~Foo() {
+ exit(0);
+ }
+};
+
+struct Bar : virtual Foo {
+};
+
+struct Baz {
+ Bar i[1];
+};
+
+int main() {
+ Baz();
+ abort();
+}
+
+