diff options
author | Loren J. Rittle <ljrittle@acm.org> | 2003-12-16 11:48:50 +0000 |
---|---|---|
committer | Loren J. Rittle <ljrittle@gcc.gnu.org> | 2003-12-16 11:48:50 +0000 |
commit | d22240b8dc0a18530eb74ea4a167f49fe6da1dd1 (patch) | |
tree | 8afdb239a1e5939d4622fcbac1f649c37aa79dfe | |
parent | 9a3a96d0a5715e9d72a83a52f517ad6b78b9f685 (diff) | |
download | gcc-d22240b8dc0a18530eb74ea4a167f49fe6da1dd1.zip gcc-d22240b8dc0a18530eb74ea4a167f49fe6da1dd1.tar.gz gcc-d22240b8dc0a18530eb74ea4a167f49fe6da1dd1.tar.bz2 |
badalloc1.C: Tweak to pass with -pthread on FreeBSD systems.
* testsuite/g++.old-deja/g++.eh/badalloc1.C: Tweak to
pass with -pthread on FreeBSD systems.
From-SVN: r74689
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C | 20 |
2 files changed, 24 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c7cd477..d1cf3a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-12-16 Loren James Rittle <ljrittle@acm.org> + + * testsuite/g++.old-deja/g++.eh/badalloc1.C: Tweak to + pass with -pthread on FreeBSD systems. + 2003-12-16 Richard Sandiford <rsandifo@redhat.com> * config/mips/mips.c (mips_file_end): Only write symbols that have diff --git a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C index 34eb37b..907474e 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();} |