* delete2.C, delete3.C, delete4.C, delete5.C: New tests.
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Sun, 21 Nov 1999 17:49:59 +0000 (17:49 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Sun, 21 Nov 1999 17:49:59 +0000 (17:49 +0000)
From-SVN: r30607

gcc/testsuite/g++.old-deja/g++.oliva/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/delete2.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.oliva/delete3.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.oliva/delete4.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.oliva/delete5.C [new file with mode: 0644]

index 79ae203b42d85a79785a198d3281b98e9ee94351..9d636f9b46efe36bc422ee372cc4170e70b8b74c 100644 (file)
@@ -1,3 +1,7 @@
+1999-11-21  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
+
+       * delete2.C, delete3.C, delete4.C, delete5.C: New tests.
+
 1999-11-19  Alexandre Oliva  <oliva@lsd.ic.unicamp.br>
 
        * template7.C: Crash test passes, bug error is now bogus.
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete2.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete2.C
new file mode 100644 (file)
index 0000000..cdd0dc5
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+// distilled from bug report by Barry M. Caceres <barryc@itravelpartners.com>
+
+// Test whether dtors of vbases are called on delete[].
+
+extern "C" void abort();
+extern "C" void exit(int);
+
+struct Foo {
+  ~Foo() {
+    std::exit(0);
+  }
+};
+
+struct Bar : virtual Foo {
+};
+
+int main() {
+  delete [] new Bar[1];
+  std::abort();
+}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete3.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete3.C
new file mode 100644 (file)
index 0000000..65932d3
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+// Test whether dtors of vbases are called on throw within new[].
+// Variant of delete2.C.
+
+extern "C" void abort();
+extern "C" void exit(int);
+
+struct Foo {
+  static bool first;
+
+  Foo() {
+    if (first)
+      first = false;
+    else
+      throw first;
+  }
+
+  ~Foo() {
+    std::exit(0);
+  }
+};
+
+bool Foo::first = true;
+
+struct Bar : virtual Foo {
+};
+
+int main() {
+  delete [] new Bar[2];
+  std::abort();
+}
+
+
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 (file)
index 0000000..def3411
--- /dev/null
@@ -0,0 +1,29 @@
+// 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() {
+    std::exit(0);
+  }
+};
+
+struct Bar : virtual Foo {
+};
+
+struct Baz {
+  Bar i[1];
+};
+
+int main() {
+  Baz();
+  std::abort();
+}
+
+
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/delete5.C b/gcc/testsuite/g++.old-deja/g++.oliva/delete5.C
new file mode 100644 (file)
index 0000000..8284525
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (C) 1999 Free Software Foundation
+
+// by Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+
+// Test whether dtors of vbases are called from dtor of auto array.
+// Variant of delete2.C, delete3.C and delete4.C.
+
+extern "C" void abort();
+extern "C" void exit(int);
+
+struct Foo {
+  ~Foo() {
+    std::exit(0);
+  }
+};
+
+struct Bar : virtual Foo {
+};
+
+void foo() {
+  Bar i[1];
+}
+
+int main() {
+  foo();
+  std::abort();
+}
+
+