libstdc++.exp (check_v3_target_binary_io): New.
* testsuite/lib/libstdc++.exp (check_v3_target_binary_io): New. * testsuite/lib/dg-options.exp (dg-require-binary-io): New. * testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc, testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc, testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc, testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc, testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc, testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc, testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc, testsuite/27_io/basic_istream/readsome/char/6746-2.cc, testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc, testsuite/27_io/objects/char/10.cc: Use dg-require-binary-io. From-SVN: r151825
This commit is contained in:
parent
e10822c2dc
commit
f16fd827c3
13 changed files with 94 additions and 0 deletions
|
@ -1,3 +1,18 @@
|
|||
2009-09-17 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* testsuite/lib/libstdc++.exp (check_v3_target_binary_io): New.
|
||||
* testsuite/lib/dg-options.exp (dg-require-binary-io): New.
|
||||
* testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc,
|
||||
testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc,
|
||||
testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc,
|
||||
testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc,
|
||||
testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc,
|
||||
testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc,
|
||||
testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc,
|
||||
testsuite/27_io/basic_istream/readsome/char/6746-2.cc,
|
||||
testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc,
|
||||
testsuite/27_io/objects/char/10.cc: Use dg-require-binary-io.
|
||||
|
||||
2009-09-17 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* include/ext/vstring.h (to_wstring(long long),
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
// 27.8.1.4 Overridden virtual functions
|
||||
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <fstream>
|
||||
#include <locale>
|
||||
#include <testsuite_hooks.h>
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
// @diff@ %-*.tst %-*.txt
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <istream>
|
||||
#include <fstream>
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
// causes "in_avail" to return an incorrect value.
|
||||
// { dg-do run { xfail arm*-*-elf arm*-*-eabi } }
|
||||
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
// 27.6.1.3 unformatted input functions
|
||||
// @require@ %-*.tst %-*.txt
|
||||
// @diff@ %-*.tst %-*.txt
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
// <http://www.gnu.org/licenses/>.
|
||||
|
||||
// { dg-require-fileio "" }
|
||||
// { dg-require-binary-io "" }
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
|
|
|
@ -151,3 +151,12 @@ proc dg-require-swprintf { args } {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
proc dg-require-binary-io { args } {
|
||||
if { ![ check_v3_target_binary_io ] } {
|
||||
upvar dg-do-what dg-do-what
|
||||
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1441,3 +1441,61 @@ proc check_v3_target_swprintf { } {
|
|||
verbose "check_v3_target_swprintf: $et_swprintf" 2
|
||||
return $et_swprintf
|
||||
}
|
||||
|
||||
proc check_v3_target_binary_io { } {
|
||||
global cxxflags
|
||||
global DEFAULT_CXXFLAGS
|
||||
global et_binary_io
|
||||
|
||||
global tool
|
||||
|
||||
if { ![info exists et_binary_io_target_name] } {
|
||||
set et_binary_io_target_name ""
|
||||
}
|
||||
|
||||
# If the target has changed since we set the cached value, clear it.
|
||||
set current_target [current_target_name]
|
||||
if { $current_target != $et_binary_io_target_name } {
|
||||
verbose "check_v3_target_binary_io: `$et_binary_io_target_name'" 2
|
||||
set et_binary_io_target_name $current_target
|
||||
if [info exists et_binary_io] {
|
||||
verbose "check_v3_target_binary_io: removing cached result" 2
|
||||
unset et_binary_io
|
||||
}
|
||||
}
|
||||
|
||||
if [info exists et_binary_io] {
|
||||
verbose "check_v3_target_binary_io: using cached result" 2
|
||||
} else {
|
||||
set et_binary_io 0
|
||||
|
||||
# Set up and compile a C++0x test program that depends
|
||||
# on text and binary I/O being the same.
|
||||
set src binary_io[pid].cc
|
||||
set exe binary_io[pid].exe
|
||||
|
||||
set f [open $src "w"]
|
||||
puts $f "#include <bits/c++config.h>"
|
||||
puts $f "int main()"
|
||||
puts $f "#if !defined(_GLIBCXX_HAVE_DOS_BASED_FILESYSTEM)"
|
||||
puts $f "{ return 0; }"
|
||||
puts $f "#endif"
|
||||
close $f
|
||||
|
||||
set cxxflags_saved $cxxflags
|
||||
set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
|
||||
|
||||
set lines [v3_target_compile $src $exe executable ""]
|
||||
set cxxflags $cxxflags_saved
|
||||
file delete $src
|
||||
|
||||
if [string match "" $lines] {
|
||||
# No error message, compilation succeeded.
|
||||
set et_binary_io 1
|
||||
} else {
|
||||
verbose "check_v3_target_binary_io: compilation failed" 2
|
||||
}
|
||||
}
|
||||
verbose "check_v3_target_binary_io: $et_binary_io" 2
|
||||
return $et_binary_io
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue