Commit 8b60fb43 by Mark Mitchell Committed by Mark Mitchell

test.html: Mention PCH_CXXFLAGS.

	* docs/html/test.html: Mention PCH_CXXFLAGS.
	* testsuite/lib/libstdc++.exp: Set PCH_CXXFLAGS by probing for an
	available stcd++.h PCH.
	* testsuite/libstdc++-dg/normal.exp: Use PCH_CXXFLAGS.

From-SVN: r100264
parent c71e3d02
2005-05-27 Mark Mitchell <mark@codesourcery.com>
* docs/html/test.html: Mention PCH_CXXFLAGS.
* testsuite/lib/libstdc++.exp: Set PCH_CXXFLAGS by probing for an
available stcd++.h PCH.
* testsuite/libstdc++-dg/normal.exp: Use PCH_CXXFLAGS.
2005-05-27 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> 2005-05-27 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* src/misc-inst.cc: Remove unnecessary included files. * src/misc-inst.cc: Remove unnecessary included files.
......
...@@ -427,8 +427,8 @@ Example 4: Testing for compilation errors on line 41 ...@@ -427,8 +427,8 @@ Example 4: Testing for compilation errors on line 41
Example 5: Testing with special command line settings, or without the Example 5: Testing with special command line settings, or without the
use of pre-compiled headers, in particular the stdc++.h.gch file. Any use of pre-compiled headers, in particular the stdc++.h.gch file. Any
options here will override the DEFAULT_CXXFLAGS set up in the options here will override the DEFAULT_CXXFLAGS and PCH_CXXFLAGS set
normal.exp file. up in the normal.exp file.
// { dg-options "-O0" { target *-*-* } } // { dg-options "-O0" { target *-*-* } }
</pre> </pre>
......
...@@ -103,14 +103,7 @@ proc libstdc++_init { testfile } { ...@@ -103,14 +103,7 @@ proc libstdc++_init { testfile } {
# headers, or without assertions. # headers, or without assertions.
global DEFAULT_CXXFLAGS global DEFAULT_CXXFLAGS
if ![info exists DEFAULT_CXXFLAGS] then { if ![info exists DEFAULT_CXXFLAGS] then {
# Set up includes for stdc++.h.gch, the precompiled header file. set DEFAULT_CXXFLAGS ""
if { [file exists $flags_file] } {
set cxxpchflags [exec sh $flags_file --cxxpchflags]
} else {
set cxxpchflags ""
}
set DEFAULT_CXXFLAGS " ${cxxpchflags}"
# Host specific goo here. # Host specific goo here.
if { [string match "powerpc-*-darwin*" $target_triplet] } { if { [string match "powerpc-*-darwin*" $target_triplet] } {
append DEFAULT_CXXFLAGS " -multiply_defined suppress" append DEFAULT_CXXFLAGS " -multiply_defined suppress"
...@@ -195,6 +188,28 @@ proc libstdc++_init { testfile } { ...@@ -195,6 +188,28 @@ proc libstdc++_init { testfile } {
} }
} }
# If a PCH file is available, use it. We must delay performing
# this check until $cxx and such have been initialized because we
# perform a test compilation. (Ideally, gcc --print-file-name would
# list PCH files, but it does not.)
global PCH_CXXFLAGS
if ![info exists PCH_CXXFLAGS] then {
set src "config[pid].cc"
set f [open $src "w"]
puts $f "int main () {}"
close $f
set lines [v3_target_compile $src "config[pid].o" object \
"additional_flags=-include additional_flags=bits/stdc++.h"]
if {$lines == "" } {
set PCH_CXXFLAGS "-include bits/stdc++.h"
} else {
set PCH_CXXFLAGS ""
}
file delete $src
v3track PCH_CXXFLAGS 2
}
libstdc++_maybe_build_wrapper "${objdir}/testglue.o" libstdc++_maybe_build_wrapper "${objdir}/testglue.o"
} }
......
...@@ -87,7 +87,8 @@ set tests [lsort $tests] ...@@ -87,7 +87,8 @@ set tests [lsort $tests]
# Main loop. # Main loop.
global DEFAULT_CXXFLAGS global DEFAULT_CXXFLAGS
dg-runtest $tests "" $DEFAULT_CXXFLAGS global PCH_CXXFLAGS
dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS"
# All done. # All done.
dg-finish dg-finish
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment