X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.brendan%2Fdtors2.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.old-deja%2Fg%2B%2B.brendan%2Fdtors2.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=1254cc670a246d569b0304549ab14c12bc64ab69;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/dtors2.C b/gcc/testsuite/g++.old-deja/g++.brendan/dtors2.C deleted file mode 100644 index 1254cc67..00000000 --- a/gcc/testsuite/g++.old-deja/g++.brendan/dtors2.C +++ /dev/null @@ -1,74 +0,0 @@ -// GROUPS passed destructors -// Check that virtual destructors work correctly. Specifically, -// check that when you destruct an object of a derived class for -// which the base class had an explicitly declared virtual destructor -// no infinite recursion occurs. -// -// Bug description: -// The generated g++ code apparently calls the base class destructor via -// the virtual table, rather than directly. This, of course, results in the -// infinite recursion. - -extern "C" int printf (const char *, ...); - -int errors = 0; - -struct base { - int member; - base(); - virtual ~base(); -}; - -base::base() -{ -} - -base::~base() -{ -} - -struct derived : public base -{ - int member; - derived(); - ~derived(); -}; - -derived::derived() : base() -{ -} - -int derived_destructor_calls = 0; - -extern void exit (int); - -derived::~derived() -{ - if (++derived_destructor_calls > 2) - errors++; -} - -void test (); - -int main () -{ - test (); - - if (errors) - { printf ("FAIL\n"); return 1; } - else - printf ("PASS\n"); - - return 0; -} - -base* bp; - -void test() -{ - derived a; - - a.member = 99; - bp = new derived; - delete bp; -}