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]

[patch] libgomp c++ testsuite improvements


Hi all,

the attached patch is looking for shared and static libstdc++. This makes the c++ part of the testsuite working on shared only builds.

I tested on darwin {ppc|i?86}, the latter with multilib build. Also tested on linux-ppc and hppa2.0w-hp-hpux11.11.

Note, the darwin i?86 testrun needs another patch to libgomp-dg.exp.

Ok for trunk?

Thanks,
Andreas

2006-12-19 Andreas Tobler <a.tobler@schweiz.org>

	* testsuite/libgomp.c++/c++.exp: Look for shared libstdc++ library and
	use it if found.

Index: libgomp.c++/c++.exp
===================================================================
--- libgomp.c++/c++.exp	(revision 119971)
+++ libgomp.c++/c++.exp	(working copy)
@@ -1,14 +1,30 @@
-set lang_library_path	"../libstdc++-v3/src/.libs"
-set lang_test_file	"${lang_library_path}/libstdc++.a"
-set lang_link_flags	"-lstdc++"
-
 load_lib libgomp-dg.exp
+load_gcc_lib target-libpath.exp
 
+global shlib_ext
+
 # Initialize dg.
 dg-init
+libgomp_init
 
-if [file exists "${blddir}/${lang_test_file}"] {
+set shlib_ext [get_shlib_extension]
+set lang_link_flags "-lstdc++"
+set lang_test_file_found 0
+set lang_library_path "../libstdc++-v3/src/.libs"
 
+# Look for a static libstdc++ first.
+if [file exists "${blddir}/${lang_library_path}/libstdc++.a"] {
+    set lang_test_file "${lang_library_path}/libstdc++.a"
+    set lang_test_file_found 1
+# We may have a shared only build, so look for a shared libstdc++.
+} elseif [file exists "${blddir}/${lang_library_path}/libstdc++.${shlib_ext}"] {
+    set lang_test_file "${lang_library_path}/libstdc++.${shlib_ext}"
+    set lang_test_file_found 1
+} else {
+    puts "No libstdc++ library found, will not execute c++ tests"
+}
+
+if { $lang_test_file_found } {
     # Gather a list of all tests.
     set tests [lsort [glob -nocomplain $srcdir/$subdir/*.C]]
 

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