aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kosnik <bkoz@redhat.com>2006-10-16 17:22:38 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2006-10-16 17:22:38 +0000
commit5f90c88f61f38c8b08a7d3883ed0b1943b8e2dc2 (patch)
treef8dfabce7d7b272b237355bb338fab54e6ff5214
parent1082fd1084c181f2dfe01b482be65f00691f895f (diff)
downloadgcc-5f90c88f61f38c8b08a7d3883ed0b1943b8e2dc2.zip
gcc-5f90c88f61f38c8b08a7d3883ed0b1943b8e2dc2.tar.gz
gcc-5f90c88f61f38c8b08a7d3883ed0b1943b8e2dc2.tar.bz2
PR libstdc++/29095 continued
2006-10-16 Benjamin Kosnik <bkoz@redhat.com> PR libstdc++/29095 continued * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): Additions so that testing not in the build directory works for the "C" target language. From-SVN: r117788
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp21
2 files changed, 25 insertions, 3 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 0aed5e0..29b5e3c 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-16 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/29095 continued
+ * testsuite/lib/libstdc++.exp (v3_target_compile_as_c): Additions
+ so that testing not in the build directory works for the "C"
+ target language.
+
2006-10-16 Jakub Jelinek <jakub@redhat.com>
* include/bits/basic_string.tcc (_Rep::_S_create): Call
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 1f877be..4030e68 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -88,6 +88,7 @@ proc libstdc++_init { testfile } {
global gluefile wrap_flags
global ld_library_path
global target_triplet
+ global flags_file
# We set LC_ALL and LANG to C so that we get the same error
# messages as expected.
@@ -191,9 +192,9 @@ proc libstdc++_init { testfile } {
set includes [exec sh $flags_file --build-includes]
} else {
set cxx [transform "g++"]
- set includes "-I${srcdir}/util"
set cxxldflags ""
set cxxflags "-g -O2 -D_GLIBCXX_ASSERT -fmessage-length=0"
+ set includes "-I${srcdir}/util"
}
}
@@ -357,6 +358,7 @@ proc v3_target_compile_as_c { source dest type options } {
global gluefile
global wrap_flags
global includes
+ global flags_file
if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
lappend options "libs=${gluefile}"
@@ -364,12 +366,25 @@ proc v3_target_compile_as_c { source dest type options } {
}
set tname [target_info name]
- set cc_final [board_info $tname compiler]
- set cxxlibglossflags [libgloss_link_flags]
+ set cc [board_info $tname compiler]
+ set cc_final $cc
+ set cxxlibglossflags [libgloss_link_flags]
set cc_final [concat $cc_final $cxxlibglossflags]
set cc_final [concat $cc_final $includes]
regsub -all ".nostdinc.." $cc_final "" cc_final
+ # This is needed for "C" tests, as this type of test may need the
+ # C++ includes. And if we're not testing in the build directory,
+ # the includes variable is not likely to include the necessary info.
+ if { ![file exists $flags_file] } {
+ set version [exec ${cc} -dumpversion]
+ set machine [exec ${cc} -dumpmachine]
+ set comp_base_dir [file dirname [file dirname [file dirname [file dirname [file dirname [exec ${cc} --print-prog-name=cc1]]]]]]
+ set includesbase "${comp_base_dir}/include/c++/${version}"
+ set includestarget "${includesbase}/${machine}"
+ set cc_final [concat $cc_final "-I$includesbase -I$includestarget"]
+ }
+
lappend options "compiler=$cc_final"
lappend options "timeout=600"