mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-07 22:27:30 +08:00
istream_extractor_arith.cc: Patch.
2000-06-19 Russell Davidson <russell@ehess.cnrs-mrs.fr> * testsuite/27_io/istream_extractor_arith.cc: Patch. * bits/locale_factets.tcc: Tweak. From-SVN: r34612
This commit is contained in:
parent
aec5061ba2
commit
7f1063f8ec
@ -1,3 +1,8 @@
|
||||
2000-06-19 Russell Davidson <russell@ehess.cnrs-mrs.fr>
|
||||
|
||||
* testsuite/27_io/istream_extractor_arith.cc: Patch.
|
||||
* bits/locale_factets.tcc: Tweak.
|
||||
|
||||
2000-06-19 Raja R Harinath <harinath@cs.umn.edu>
|
||||
|
||||
* src/Makefile.am: change @WERROR@ to $(WERROR) so that this can
|
||||
|
@ -905,9 +905,9 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
|
||||
dnl in libstdc++, which we are building right now.
|
||||
dnl Yet, we need to use the c++ compiler so that __cplusplus is defined.
|
||||
dnl So, use this.
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS='-x c++'
|
||||
# ac_test_CFLAGS="${CFLAGS+set}"
|
||||
# ac_save_CFLAGS="$CFLAGS"
|
||||
# CFLAGS='-x c++'
|
||||
|
||||
dnl Check libm
|
||||
AC_CHECK_LIB(m, sin, libm="-lm")
|
||||
@ -937,7 +937,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
|
||||
_sincosl _finite _finitef _finitel _fqfinite _fpclass _qfpclass)
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
# CFLAGS="$ac_save_CFLAGS"
|
||||
])
|
||||
|
||||
|
||||
|
10
libstdc++-v3/aclocal.m4
vendored
10
libstdc++-v3/aclocal.m4
vendored
@ -913,13 +913,13 @@ dnl
|
||||
dnl GLIBCPP_CHECK_MATH_SUPPORT
|
||||
AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
|
||||
|
||||
dnl NB: can't use AC_LANG_CPLUSPLUS here, because g++ tries to link
|
||||
dnl NB: Can't use AC_LANG_CPLUSPLUS here, because g++ tries to link
|
||||
dnl in libstdc++, which we are building right now.
|
||||
dnl Yet, we need to use the c++ compiler so that __cplusplus is defined.
|
||||
dnl So, use this.
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS='-x c++'
|
||||
# ac_test_CFLAGS="${CFLAGS+set}"
|
||||
# ac_save_CFLAGS="$CFLAGS"
|
||||
# CFLAGS='-x c++'
|
||||
|
||||
dnl Check libm
|
||||
AC_CHECK_LIB(m, sin, libm="-lm")
|
||||
@ -949,7 +949,7 @@ AC_DEFUN(GLIBCPP_CHECK_MATH_SUPPORT, [
|
||||
_sincosl _finite _finitef _finitel _fqfinite _fpclass _qfpclass)
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
# CFLAGS="$ac_save_CFLAGS"
|
||||
])
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
8
libstdc++-v3/configure
vendored
8
libstdc++-v3/configure
vendored
@ -4757,9 +4757,9 @@ cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
|
||||
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS='-x c++'
|
||||
# ac_test_CFLAGS="${CFLAGS+set}"
|
||||
# ac_save_CFLAGS="$CFLAGS"
|
||||
# CFLAGS='-x c++'
|
||||
|
||||
echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
|
||||
echo "configure:4766: checking for sin in -lm" >&5
|
||||
@ -4990,7 +4990,7 @@ done
|
||||
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
# CFLAGS="$ac_save_CFLAGS"
|
||||
|
||||
|
||||
for ac_hdr in complex.h
|
||||
|
@ -378,6 +378,110 @@ bool test09()
|
||||
return test;
|
||||
}
|
||||
|
||||
bool test10() {
|
||||
std::string str_01("0 00 000 +0 + 0 - 0");
|
||||
std::stringbuf isbuf_01(str_01);
|
||||
std::istream is_01(&isbuf_01);
|
||||
|
||||
bool test = true;
|
||||
|
||||
int n = 365;
|
||||
is_01 >> n;
|
||||
test &= n == 0;
|
||||
n = 364;
|
||||
is_01 >> n;
|
||||
test &= n == 0;
|
||||
n = 363;
|
||||
is_01 >> n;
|
||||
test &= n == 0;
|
||||
n = 362;
|
||||
is_01 >> n;
|
||||
test &= n == 0;
|
||||
n = 361;
|
||||
is_01 >> n;
|
||||
test &= n == 0;
|
||||
n = 360;
|
||||
is_01 >> n;
|
||||
test &= n == 0;
|
||||
test &= is_01.rdstate() == std::ios_base::eofbit;
|
||||
|
||||
std::string str_02("0x32 0X33 033 33");
|
||||
std::stringbuf isbuf_02(str_02);
|
||||
std::istream is_02(&isbuf_02);
|
||||
is_02.unsetf(std::ios_base::basefield);
|
||||
is_02 >> n;
|
||||
test &= n == 50;
|
||||
is_02 >> n;
|
||||
test &= n == 51;
|
||||
is_02 >> n;
|
||||
test &= n == 27;
|
||||
is_02 >> n;
|
||||
test &= n == 33;
|
||||
test &= is_02.rdstate() == std::ios_base::eofbit;
|
||||
|
||||
std::stringbuf isbuf_03(str_02);
|
||||
std::istream is_03(&isbuf_03);
|
||||
char c;
|
||||
int m;
|
||||
|
||||
is_03 >> std::dec >> n >> c >> m;
|
||||
test &= n == 0;
|
||||
test &= c == 'x';
|
||||
test &= m == 32;
|
||||
|
||||
is_03 >> std::oct >> m >> c >> n;
|
||||
test &= m == 0;
|
||||
test &= c == 'X';
|
||||
test &= n == 27;
|
||||
|
||||
is_03 >> std::dec >> m >> n;
|
||||
test &= m == 33;
|
||||
test &= n == 33;
|
||||
test &= is_03.rdstate() == std::ios_base::eofbit;
|
||||
|
||||
std::string str_04("3. 4.5E+ 2a5E-3 .6E1");
|
||||
std::stringbuf isbuf_04(str_04);
|
||||
std::istream is_04(&isbuf_04);
|
||||
|
||||
double f;
|
||||
is_04 >> f;
|
||||
test &= f == 3.0;
|
||||
is_04 >> f;
|
||||
test &= f == 450.0;
|
||||
is_04.ignore();
|
||||
is_04 >> f;
|
||||
test &= f == 0.005;
|
||||
is_04 >> f;
|
||||
test &= f == 6;
|
||||
test &= is_03.rdstate() == std::ios_base::eofbit;
|
||||
|
||||
std::string str_05("0E20 5Ea E16");
|
||||
std::stringbuf isbuf_05(str_05);
|
||||
std::istream is_05(&isbuf_05);
|
||||
|
||||
is_05 >> f;
|
||||
test &= f == 0;
|
||||
is_05 >> f;
|
||||
test &= f == 0;
|
||||
test &= is_05.rdstate() == std::ios_base::failbit;
|
||||
is_05.clear();
|
||||
is_05 >> c;
|
||||
test &= c == 'a';
|
||||
is_05 >> f;
|
||||
test &= f == 0;
|
||||
test &= is_05.rdstate() == std::ios_base::failbit;
|
||||
is_05.clear();
|
||||
is_05.ignore();
|
||||
is_05 >> n;
|
||||
test &= n == 16;
|
||||
|
||||
#ifdef DEBUG_ASSERT
|
||||
assert(test);
|
||||
#endif
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test01();
|
||||
@ -388,6 +492,7 @@ int main()
|
||||
test07();
|
||||
test08();
|
||||
test09();
|
||||
test10();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user