From a21676d1abc2a59977f74d9bef006c132c8b5373 Mon Sep 17 00:00:00 2001 From: mmitchel Date: Fri, 27 May 2005 16:24:59 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100264 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 7 ++++++ libstdc++-v3/docs/html/test.html | 4 ++-- libstdc++-v3/testsuite/lib/libstdc++.exp | 31 +++++++++++++++++++------- libstdc++-v3/testsuite/libstdc++-dg/normal.exp | 3 ++- 4 files changed, 34 insertions(+), 11 deletions(-) (limited to 'libstdc++-v3') diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index c773bc2b831..ab8a1286dd7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2005-05-27 Mark Mitchell + + * 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 * src/misc-inst.cc: Remove unnecessary included files. diff --git a/libstdc++-v3/docs/html/test.html b/libstdc++-v3/docs/html/test.html index d15dc427180..41e0529e6c6 100644 --- a/libstdc++-v3/docs/html/test.html +++ b/libstdc++-v3/docs/html/test.html @@ -427,8 +427,8 @@ Example 4: Testing for compilation errors on line 41 Example 5: Testing with special command line settings, or without the use of pre-compiled headers, in particular the stdc++.h.gch file. Any -options here will override the DEFAULT_CXXFLAGS set up in the -normal.exp file. +options here will override the DEFAULT_CXXFLAGS and PCH_CXXFLAGS set +up in the normal.exp file. // { dg-options "-O0" { target *-*-* } } diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 2dbf8217938..bcae3777e75 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -103,14 +103,7 @@ proc libstdc++_init { testfile } { # headers, or without assertions. global DEFAULT_CXXFLAGS if ![info exists DEFAULT_CXXFLAGS] then { - # Set up includes for stdc++.h.gch, the precompiled header file. - if { [file exists $flags_file] } { - set cxxpchflags [exec sh $flags_file --cxxpchflags] - } else { - set cxxpchflags "" - } - set DEFAULT_CXXFLAGS " ${cxxpchflags}" - + set DEFAULT_CXXFLAGS "" # Host specific goo here. if { [string match "powerpc-*-darwin*" $target_triplet] } { append DEFAULT_CXXFLAGS " -multiply_defined suppress" @@ -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" } diff --git a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp index 746c7a8ec3f..9d2f1a63a9a 100644 --- a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp +++ b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp @@ -87,7 +87,8 @@ set tests [lsort $tests] # Main loop. global DEFAULT_CXXFLAGS -dg-runtest $tests "" $DEFAULT_CXXFLAGS +global PCH_CXXFLAGS +dg-runtest $tests "" "$DEFAULT_CXXFLAGS $PCH_CXXFLAGS" # All done. dg-finish -- cgit v1.2.1