From 76ccdb3c4a529e14d082a270366294ff29d1625b Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 2 May 2002 05:14:31 +0000 Subject: [PATCH] * g++.dg/init/dtor1.C: New test. From-SVN: r53033 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.dg/init/dtor1.C | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 gcc/testsuite/g++.dg/init/dtor1.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e12dc075440..d24d0e408b3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2002-05-01 Mark Mitchell + + * g++.dg/init/dtor1.C: New test. + 2002-05-02 Aldy Hernandez * gcc.dg/altivec-8.c: New. diff --git a/gcc/testsuite/g++.dg/init/dtor1.C b/gcc/testsuite/g++.dg/init/dtor1.C new file mode 100644 index 00000000000..3a48bcd77ac --- /dev/null +++ b/gcc/testsuite/g++.dg/init/dtor1.C @@ -0,0 +1,27 @@ +// { dg-do run } + +extern "C" void abort (); + +int d = 2; + +struct B +{ + int x; + B (int i) : x (i) { } + ~B () { if (d-- != x) abort (); } +}; + +struct A + : public B +{ + A () : B (0), x1(1), x2(2) {} + B x1; + B x2; +}; + + +int main () +{ + A a; + return 0; +}