This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Run init tests only when __cxa_atexit is supported.


Here is an update of my change to XFAIL the init5, init18, and init19
tests on systems that do not support __cxa_atexit.  init18 was also
changed to use _exit instead of _Exit and to not run it on some
platforms that don't support _exit.  That part of the change was OKed by
Mark Mitchell but it wasn't clear to me if I had approval for the
patch as a whole so I thought I would resend it now that I have changed
it and retested it.

Tested on IA64 HP-UX and Linux.  On Linux I got PASS for these tests and
for HP-UX I got XFAIL, which is what I expected.

OK to checkin?

Steve Ellcey
sje@cup.hp.com


2006-06-02  Steve Ellcey  <sje@cup.hp.com>

	* g++.old-deja/g++.other/init5.C: XFAIL if cxa-atexit is false.
	* g++.old-deja/g++.other/init19.C: Ditto.
	* g++.old-deja/g++.other/init18.C: Ditto, plus change _Exit to _exit
	and add other platforms as expected failures.


Index: g++.old-deja/g++.other/init5.C
===================================================================
--- g++.old-deja/g++.other/init5.C	(revision 114325)
+++ g++.old-deja/g++.other/init5.C	(working copy)
@@ -1,4 +1,4 @@
-// { dg-do run }
+// { dg-do run { xfail { ! cxa_atexit } } }
 // Objects must be destructed in decreasing cnt order
 // Original test attributed to James Kanze <jkanze@otelo.ibmmail.com>
 
Index: g++.old-deja/g++.other/init19.C
===================================================================
--- g++.old-deja/g++.other/init19.C	(revision 114325)
+++ g++.old-deja/g++.other/init19.C	(working copy)
@@ -1,4 +1,4 @@
-// { dg-do run }
+// { dg-do run { xfail { ! cxa_atexit } } }
 #include <stdlib.h>
 
 #define assert(x) do { if (! (x)) abort(); } while (0)
Index: g++.old-deja/g++.other/init18.C
===================================================================
--- g++.old-deja/g++.other/init18.C	(revision 114325)
+++ g++.old-deja/g++.other/init18.C	(working copy)
@@ -1,6 +1,14 @@
-// { dg-do run }
+// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
+// in their dejagnu baseboard description) require that the status is
+// final when exit is entered (or main returns), and not "overruled" by a
+// destructor calling _exit.  It's not really worth it to handle that.
+//
+// Any platform that doesn't have proper __cxa_atexit support will also fail.
+//
+// { dg-do run { xfail { { mmix-knuth-mmixware xtensa-*-elf* arm*-*-elf arm*-*-eabim68k-*-elf } || { ! cxa_atexit } } } }
 
 #include <stdlib.h>
+extern "C" void _exit (int);
 
 static int cnt = 0;
 
@@ -8,7 +16,7 @@ class Foo2
 {
 	public:
 		Foo2() {};
-		~Foo2() { if (++cnt == 2) _Exit (0); };
+		~Foo2() { if (++cnt == 2) _exit (0); };
 };
 
 static Foo2& GetFoo2()


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]