diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-06 22:12:34 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-10-06 22:12:34 +0000 |
commit | c37e7a9d014bc482424c4068fdd5944d023c57e9 (patch) | |
tree | 09d00f21fa64925e280dcf8b8337f681a42ec84f /libstdc++-v3/testsuite | |
parent | 44be9f6ef17c4c8b6e09d528c9c60d6632af1eda (diff) | |
download | gcc-c37e7a9d014bc482424c4068fdd5944d023c57e9.tar.gz |
2004-10-06 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCXX_ENABLE_THREADS): Set enable_thread.
(GLIBCXX_CONFIGURE_TESTSUITE): Use it.
* configure: Regenerated.
* testsuite/Makefile.am (CLEANFILES): Add TEST for
check-performance executables.
(stamp_thread): New.
(all-local): Use it.
* testsuite/Makefile.in: Regenerate.
* scripts/create_testsuite_files: Filter thread tests.
* testsuite/thread/pthread1.cc: Remove macro conditionals: this
file will only be run by thread enabled configurations.
* testsuite/thread/pthread7-rope.cc: Same, add rope_type typedef.
* testsuite/thread/pthread6.cc: Same.
* testsuite/thread/pthread5.cc: Same.
* testsuite/thread/pthread4.cc: Same.
* testsuite/thread/pthread3.cc: Same.
* testsuite/thread/pthread2.cc: Same.
* testsuite/ext/mt_allocator/instantiate.cc: Add in __GTHREADS guard.
* testsuite/ext/mt_allocator/deallocate_global-1.cc: Move to...
* testsuite/ext/mt_allocator/deallocate_global_thread-1.cc: ...here.
* testsuite/ext/mt_allocator/deallocate_global-3.cc: Move to...
* testsuite/ext/mt_allocator/deallocate_global_thread-3.cc: ...here.
* testsuite/ext/mt_allocator/deallocate_local-1.cc: Move to...
* testsuite/ext/mt_allocator/deallocate_local_thread-1.cc: ...here.
* testsuite/ext/mt_allocator/deallocate_local-3.cc: Move to...
* testsuite/ext/mt_allocator/deallocate_local_thread-3.cc: ...here.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88628 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/testsuite')
14 files changed, 28 insertions, 42 deletions
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am index 9e11ac30ae9..a003497ecaf 100644 --- a/libstdc++-v3/testsuite/Makefile.am +++ b/libstdc++-v3/testsuite/Makefile.am @@ -57,7 +57,7 @@ endif abi_check_SOURCES = abi_check.cc abi_check_DEPENDENCIES = libv3test.a -all-local: stamp_wchar testsuite_files +all-local: stamp_wchar stamp_thread testsuite_files # Enable wchar_t tests if capable. if GLIBCXX_TEST_WCHAR_T @@ -67,6 +67,14 @@ else stamp_wchar: endif +# Enable thread tests if capable. +if GLIBCXX_TEST_THREAD +stamp_thread: + touch testsuite_thread +else +stamp_thread: +endif + # Generated lists of files to run. All of these names are valid make # targets, if you wish to generate a list manually. lists_of_files = \ @@ -183,4 +191,4 @@ check-script check-script-install check-performance # By adding these files here, automake will remove them for 'make clean' CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \ - testsuite_* site.exp abi_check baseline_symbols + testsuite_* site.exp abi_check baseline_symbols *TEST* diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in index 3a79b7ec10b..1005b34e58d 100644 --- a/libstdc++-v3/testsuite/Makefile.in +++ b/libstdc++-v3/testsuite/Makefile.in @@ -146,6 +146,8 @@ GLIBCXX_HOSTED_TRUE = @GLIBCXX_HOSTED_TRUE@ GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@ GLIBCXX_TEST_ABI_FALSE = @GLIBCXX_TEST_ABI_FALSE@ GLIBCXX_TEST_ABI_TRUE = @GLIBCXX_TEST_ABI_TRUE@ +GLIBCXX_TEST_THREAD_FALSE = @GLIBCXX_TEST_THREAD_FALSE@ +GLIBCXX_TEST_THREAD_TRUE = @GLIBCXX_TEST_THREAD_TRUE@ GLIBCXX_TEST_WCHAR_T_FALSE = @GLIBCXX_TEST_WCHAR_T_FALSE@ GLIBCXX_TEST_WCHAR_T_TRUE = @GLIBCXX_TEST_WCHAR_T_TRUE@ INSTALL_DATA = @INSTALL_DATA@ @@ -311,7 +313,7 @@ performance_script = ${glibcxx_srcdir}/scripts/check_performance # By adding these files here, automake will remove them for 'make clean' CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \ - testsuite_* site.exp abi_check baseline_symbols + testsuite_* site.exp abi_check baseline_symbols *TEST* all: all-am @@ -575,13 +577,18 @@ uninstall-am: uninstall-info-am tags uninstall uninstall-am uninstall-info-am -all-local: stamp_wchar testsuite_files +all-local: stamp_wchar stamp_thread testsuite_files # Enable wchar_t tests if capable. @GLIBCXX_TEST_WCHAR_T_TRUE@stamp_wchar: @GLIBCXX_TEST_WCHAR_T_TRUE@ touch testsuite_wchar_t @GLIBCXX_TEST_WCHAR_T_FALSE@stamp_wchar: +# Enable thread tests if capable. +@GLIBCXX_TEST_THREAD_TRUE@stamp_thread: +@GLIBCXX_TEST_THREAD_TRUE@ touch testsuite_thread +@GLIBCXX_TEST_THREAD_FALSE@stamp_thread: + # We need more things in site.exp, but automake completely controls the # creation of that file; there's no way to append to it without messing up # the dependancy chains. So we overrule automake. This rule is exactly diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc index 1f0ac281af7..1f0ac281af7 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-1.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc index 10efea66ec6..10efea66ec6 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-3.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-1.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc index 5664d3caff8..5664d3caff8 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-1.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-3.cc b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc index 973f758d98d..973f758d98d 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-3.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc diff --git a/libstdc++-v3/testsuite/ext/mt_allocator/instantiate.cc b/libstdc++-v3/testsuite/ext/mt_allocator/instantiate.cc index 579b8bcf18d..4fa49aa09cc 100644 --- a/libstdc++-v3/testsuite/ext/mt_allocator/instantiate.cc +++ b/libstdc++-v3/testsuite/ext/mt_allocator/instantiate.cc @@ -27,7 +27,9 @@ using namespace __gnu_cxx; template class __mt_alloc<int>; -template class __mt_alloc<short, __common_pool_policy<true> >; template class __mt_alloc<short, __common_pool_policy<false> >; -template class __mt_alloc<short, __per_type_pool_policy<short, true> >; template class __mt_alloc<short, __per_type_pool_policy<short, false> >; +#ifdef __GTHREADS +template class __mt_alloc<short, __common_pool_policy<true> >; +template class __mt_alloc<short, __per_type_pool_policy<short, true> >; +#endif diff --git a/libstdc++-v3/testsuite/thread/pthread1.cc b/libstdc++-v3/testsuite/thread/pthread1.cc index 1b225f202c6..26d198a755e 100644 --- a/libstdc++-v3/testsuite/thread/pthread1.cc +++ b/libstdc++-v3/testsuite/thread/pthread1.cc @@ -34,7 +34,6 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS using namespace std; const int thread_cycles = 10; @@ -135,6 +134,3 @@ main () return 0; } -#else -int main (void) {} -#endif diff --git a/libstdc++-v3/testsuite/thread/pthread2.cc b/libstdc++-v3/testsuite/thread/pthread2.cc index 7fbdfc03aeb..7a0efd067a2 100644 --- a/libstdc++-v3/testsuite/thread/pthread2.cc +++ b/libstdc++-v3/testsuite/thread/pthread2.cc @@ -28,8 +28,6 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS - const int max_thread_count = 2; const int max_loop_count = 1000000; @@ -62,6 +60,3 @@ main() return 0; } -#else -int main (void) {} -#endif diff --git a/libstdc++-v3/testsuite/thread/pthread3.cc b/libstdc++-v3/testsuite/thread/pthread3.cc index ca8f77147e7..4696fb76cdc 100644 --- a/libstdc++-v3/testsuite/thread/pthread3.cc +++ b/libstdc++-v3/testsuite/thread/pthread3.cc @@ -28,8 +28,6 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS - const int max_thread_count = 2; const int max_loop_count = 1000000; @@ -59,6 +57,3 @@ main() return 0; } -#else -int main (void) {} -#endif diff --git a/libstdc++-v3/testsuite/thread/pthread4.cc b/libstdc++-v3/testsuite/thread/pthread4.cc index be1ae680fa7..a9ec9b84e38 100644 --- a/libstdc++-v3/testsuite/thread/pthread4.cc +++ b/libstdc++-v3/testsuite/thread/pthread4.cc @@ -30,7 +30,6 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS using namespace std; static list<string> foo; @@ -113,6 +112,3 @@ main (void) return 0; } -#else -int main (void) {} -#endif diff --git a/libstdc++-v3/testsuite/thread/pthread5.cc b/libstdc++-v3/testsuite/thread/pthread5.cc index b950542fd61..93f03a22761 100644 --- a/libstdc++-v3/testsuite/thread/pthread5.cc +++ b/libstdc++-v3/testsuite/thread/pthread5.cc @@ -31,7 +31,6 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS #ifdef _GLIBCXX_HAVE_UNISTD_H #include <unistd.h> // To test for _POSIX_THREAD_PRIORITY_SCHEDULING #endif @@ -130,6 +129,3 @@ main () return (0); } -#else -int main (void) {} -#endif diff --git a/libstdc++-v3/testsuite/thread/pthread6.cc b/libstdc++-v3/testsuite/thread/pthread6.cc index e0fee71deac..ba8c341c3f8 100644 --- a/libstdc++-v3/testsuite/thread/pthread6.cc +++ b/libstdc++-v3/testsuite/thread/pthread6.cc @@ -30,8 +30,6 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS - const int max_thread_count = 8; const int loops = 100000; @@ -94,6 +92,3 @@ main (void) return 0; } -#else -int main (void) {} -#endif diff --git a/libstdc++-v3/testsuite/thread/pthread7-rope.cc b/libstdc++-v3/testsuite/thread/pthread7-rope.cc index 2f401344ff4..307973c202d 100644 --- a/libstdc++-v3/testsuite/thread/pthread7-rope.cc +++ b/libstdc++-v3/testsuite/thread/pthread7-rope.cc @@ -29,13 +29,12 @@ // Do not include <pthread.h> explicitly; if threads are properly // configured for the port, then it is picked up free from STL headers. -#if __GTHREADS - const int max_thread_count = 4; const int max_loop_count = 10000; -__gnu_cxx::crope foo2; -__gnu_cxx::crope foo4; +typedef __gnu_cxx::rope<char, std::allocator<char> > rope_type; +rope_type foo2; +rope_type foo4; void* thread_main(void *) { @@ -73,7 +72,7 @@ main() pthread_setconcurrency (max_thread_count); #endif - __gnu_cxx::crope foo; + rope_type foo; foo += "bar"; foo += "baz"; foo += "bongle"; @@ -89,7 +88,7 @@ main() VERIFY( !std::strcmp (data2, "bar2baz2bongle2") ); } - __gnu_cxx::crope foo3 ("hello"); + rope_type foo3 ("hello"); const char* data3 = foo3.c_str(); VERIFY( !std::strcmp (data3, "hello") ); @@ -112,6 +111,3 @@ main() return 0; } -#else -int main (void) {} -#endif |