diff options
author | ljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-16 11:48:50 +0000 |
---|---|---|
committer | ljrittle <ljrittle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-12-16 11:48:50 +0000 |
commit | 6074aa16c199f005c031b1f59fd53719d0268ee5 (patch) | |
tree | 8afdb239a1e5939d4622fcbac1f649c37aa79dfe /gcc/testsuite/g++.old-deja | |
parent | d39cc8d31b71e5bac9e88668eb808db01be2af10 (diff) | |
download | gcc-6074aa16c199f005c031b1f59fd53719d0268ee5.tar.gz |
* testsuite/g++.old-deja/g++.eh/badalloc1.C: Tweak to
pass with -pthread on FreeBSD systems.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.old-deja')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C index 34eb37b373c..907474e13fa 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C @@ -1,5 +1,5 @@ // { dg-do run { xfail xstormy16-*-* *-*-darwin* } } -// Copyright (C) 2000, 2002 Free Software Foundation, Inc. +// Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com> // Check we can throw a bad_alloc exception when malloc dies. @@ -14,8 +14,15 @@ extern "C" void *memcpy(void *, const void *, size_t); #ifdef STACK_SIZE const int arena_size = 256; #else +#ifdef __FreeBSD__ +// FreeBSD with threads requires even more space at initialization time. +#include "bits/c++config.h" +#include "bits/gthr.h" +const int arena_size = 131072; +#else const int arena_size = 32768; #endif +#endif struct object { @@ -98,6 +105,17 @@ void fn_catchthrow() throw(int) int main() { +#ifdef __FreeBSD__ +// FreeBSD with threads fails the test unless each thread primes itself. + if (__gthread_active_p()) + { + try{fn_throw();} + catch(int a){} + } +// This was added to test with well-known idiom to detect regressions here +// rather than always failing with -pthread. +#endif + fail = 1; try{fn_throw();} |