Commit 3de87817 by Mark Mitchell Committed by Joseph Myers

badalloc1.C: Robustify.

2004-11-26  Mark Mitchell  <mark@codesourcery.com>

	* g++.old-deja/g++.eh/badalloc1.C: Robustify.

From-SVN: r91352
parent 9fcc7481
2004-11-26 Mark Mitchell <mark@codesourcery.com>
* g++.old-deja/g++.eh/badalloc1.C: Robustify.
2004-11-26 Richard Sandiford <rsandifo@redhat.com> 2004-11-26 Richard Sandiford <rsandifo@redhat.com>
* gcc.dg/sibcall-[34].c: Remove MIPS xfails. * gcc.dg/sibcall-[34].c: Remove MIPS xfails.
......
...@@ -14,10 +14,9 @@ extern "C" void *memcpy(void *, const void *, size_t); ...@@ -14,10 +14,9 @@ extern "C" void *memcpy(void *, const void *, size_t);
#ifdef STACK_SIZE #ifdef STACK_SIZE
const int arena_size = 256; const int arena_size = 256;
#else #else
#ifdef __FreeBSD__ #if defined(__FreeBSD__) || defined(__sun__)
// FreeBSD with threads requires even more space at initialization time. // FreeBSD with threads and Solaris with threads require even more
#include "bits/c++config.h" // space at initialization time.
#include "bits/gthr.h"
const int arena_size = 131072; const int arena_size = 131072;
#else #else
const int arena_size = 32768; const int arena_size = 32768;
...@@ -105,16 +104,15 @@ void fn_catchthrow() throw(int) ...@@ -105,16 +104,15 @@ void fn_catchthrow() throw(int)
int main() int main()
{ {
#ifdef __FreeBSD__ /* On some systems (including FreeBSD and Solaris 2.10),
// FreeBSD with threads fails the test unless each thread primes itself. __cxa_get_globals will try to call "malloc" when threads are in
if (__gthread_active_p()) use. Therefore, we throw one exception up front so that
{ __cxa_get_globals is all set up. Ideally, this would not be
try{fn_throw();} necessary, but it is a well-known idiom, and using this technique
catch(int a){} means that we can still validate the fact that exceptions can be
} thrown when malloc fails. */
// This was added to test with well-known idiom to detect regressions here try{fn_throw();}
// rather than always failing with -pthread. catch(int a){}
#endif
fail = 1; fail = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment