This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[v3] 18/21 conformance testing



Insanely boring...

2001-06-19  Benjamin Kosnik  <bkoz@redhat.com>

	* mknumeric_limits: Add static defintions, format.
	* testsuite/18_support/numeric_limits.cc (test02): Add test.

	* include/c_std/bits/std_cwchar.h: Include ctime.
	* testsuite/17_intro/header_cwchar.cc : Check.

	* include/c_std/bits/std_cwctype.h: Inject wctype.
	* testsuite/17_intro/header_cwctype.cc: Update.


Index: mknumeric_limits
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/mknumeric_limits,v
retrieving revision 1.13
diff -c -p -r1.13 mknumeric_limits
*** mknumeric_limits	2001/05/25 22:19:25	1.13
--- mknumeric_limits	2001/06/20 03:03:03
*************** cat <<EOF > $OUT_H-t
*** 99,165 ****
  #include <bits/c++config.h>
  #include <bits/std_cfloat.h>
  
! namespace std {
! 
!     enum float_round_style {
!         round_indeterminate       = -1,
!         round_toward_zero         = 0,
!         round_to_nearest          = 1,
!         round_toward_infinity     = 2,
!         round_toward_neg_infinity = 3
!     };
! 
!     enum float_denorm_style {
!         denorm_indeterminate = -1,
!         denorm_absent        = 0,
!         denorm_present       = 1
!     };
! 
!     template<typename _Tp> struct numeric_limits {
!         static const bool is_specialized = false;
! 
!         static _Tp min() throw() { return static_cast<_Tp>(0); }
!         static _Tp max() throw() { return static_cast<_Tp>(0); }
! 
!         static const int digits = 0;
!         static const int digits10 = 0;
!         static const bool is_signed = false;
!         static const bool is_integer = false;
!         static const bool is_exact = false;
!         static const int radix = 0;
! 
!         static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
!         static _Tp round_error() throw() { return static_cast<_Tp>(0); }
! 
!         static const int min_exponent = 0;
!         static const int min_exponent10 = 0;
!         static const int max_exponent = 0;
!         static const int max_exponent10 = 0;
! 
!         static const bool has_infinity = false;
!         static const bool has_quiet_NaN = false;
!         static const bool has_signaling_NaN = false;
!         static const float_denorm_style has_denorm = denorm_absent;
!         static const bool has_denorm_loss = false;
! 
!         static _Tp infinity() throw()  { return static_cast<_Tp>(0); }
!         static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
!         static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
!         static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
! 
!         static const bool is_iec559 = false;
!         static const bool is_bounded = false;
!         static const bool is_modulo = false;
! 
!         static const bool traps = false;
!         static const bool tinyness_before = false;
!         static const float_round_style round_style = round_toward_zero;
      };
  
!     template<typename _Tp> _Tp __limits_infinity();
!     template<typename _Tp> _Tp __limits_quiet_NaN();
!     template<typename _Tp> _Tp __limits_signaling_NaN();
!     template<typename _Tp> _Tp __limits_denorm_min();
  
  EOF
  
--- 99,257 ----
  #include <bits/c++config.h>
  #include <bits/std_cfloat.h>
  
! namespace std
! {
!   enum float_round_style 
!   {
!     round_indeterminate       = -1,
!     round_toward_zero         = 0,
!     round_to_nearest          = 1,
!     round_toward_infinity     = 2,
!     round_toward_neg_infinity = 3
!   };
! 
!   enum float_denorm_style 
!   {
!     denorm_indeterminate = -1,
!     denorm_absent        = 0,
!     denorm_present       = 1
!   };
! 
!   template<typename _Tp> 
!     struct numeric_limits 
!     {
!       static const bool is_specialized = false;
! 
!       static _Tp min() throw() { return static_cast<_Tp>(0); }
!       static _Tp max() throw() { return static_cast<_Tp>(0); }
! 
!       static const int digits = 0;
!       static const int digits10 = 0;
!       static const bool is_signed = false;
!       static const bool is_integer = false;
!       static const bool is_exact = false;
!       static const int radix = 0;
! 
!       static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
!       static _Tp round_error() throw() { return static_cast<_Tp>(0); }
! 
!       static const int min_exponent = 0;
!       static const int min_exponent10 = 0;
!       static const int max_exponent = 0;
!       static const int max_exponent10 = 0;
! 
!       static const bool has_infinity = false;
!       static const bool has_quiet_NaN = false;
!       static const bool has_signaling_NaN = false;
!       static const float_denorm_style has_denorm = denorm_absent;
!       static const bool has_denorm_loss = false;
! 
!       static _Tp infinity() throw()  { return static_cast<_Tp>(0); }
!       static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
!       static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
!       static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
! 
!       static const bool is_iec559 = false;
!       static const bool is_bounded = false;
!       static const bool is_modulo = false;
! 
!       static const bool traps = false;
!       static const bool tinyness_before = false;
!       static const float_round_style round_style = round_toward_zero;
      };
  
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_specialized;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::digits;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::digits10;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_signed;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_integer;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_exact;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::radix;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::min_exponent;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::min_exponent10;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::max_exponent;
! 
!   template<typename _Tp> 
!     const int
!     numeric_limits<_Tp>::max_exponent10;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::has_infinity;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::has_quiet_NaN;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::has_signaling_NaN;
! 
!   template<typename _Tp> 
!     const float_denorm_style
!     numeric_limits<_Tp>::has_denorm;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::has_denorm_loss;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_iec559;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_bounded;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::is_modulo;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::traps;
! 
!   template<typename _Tp> 
!     const bool
!     numeric_limits<_Tp>::tinyness_before;
! 
!   template<typename _Tp> 
!     const float_round_style
!     numeric_limits<_Tp>::round_style;
! 
!   template<typename _Tp> _Tp __limits_infinity();
!   template<typename _Tp> _Tp __limits_quiet_NaN();
!   template<typename _Tp> _Tp __limits_signaling_NaN();
!   template<typename _Tp> _Tp __limits_denorm_min();
  
  EOF
  
*************** EOF
*** 271,273 ****
--- 363,367 ----
  
  mv $OUT_C-t $OUT_C
  mv $OUT_H-t $OUT_H
+ 
+ 
Index: include/c_std/bits/std_cwchar.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cwchar.h,v
retrieving revision 1.16
diff -c -p -r1.16 std_cwchar.h
*** std_cwchar.h	2001/06/11 04:36:59	1.16
--- std_cwchar.h	2001/06/20 03:03:05
***************
*** 28,34 ****
  // the GNU General Public License.
  
  //
! // ISO C++ 14882: ???
  //
  
  #ifndef _CPP_CWCHAR
--- 28,34 ----
  // the GNU General Public License.
  
  //
! // ISO C++ 14882: 21.4
  //
  
  #ifndef _CPP_CWCHAR
***************
*** 36,41 ****
--- 36,42 ----
  
  #include <bits/c++config.h>
  #include <bits/std_cstddef.h>
+ #include <bits/std_ctime.h>
  
  #if _GLIBCPP_HAVE_WCHAR_H
  #pragma GCC system_header
Index: include/c_std/bits/std_cwctype.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/bits/std_cwctype.h,v
retrieving revision 1.5
diff -c -p -r1.5 std_cwctype.h
*** std_cwctype.h	2001/06/08 23:22:26	1.5
--- std_cwctype.h	2001/06/20 03:03:05
***************
*** 56,61 ****
--- 56,62 ----
  #undef towupper
  #undef towctrans
  #undef wctrans
+ #undef wctype
  
  namespace std
  {
*************** namespace std
*** 82,87 ****
--- 83,89 ----
    using ::towupper;
    using ::towctrans;
    using ::wctrans;
+   using ::wctype;
  }
  
  #endif 
Index: testsuite/17_intro/header_cwchar.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/17_intro/header_cwchar.cc,v
retrieving revision 1.3
diff -c -p -r1.3 header_cwchar.cc
*** header_cwchar.cc	2001/05/12 16:51:41	1.3
--- header_cwchar.cc	2001/06/20 03:03:06
*************** int main(void)
*** 27,31 ****
--- 27,34 ----
  {
    // Make sure size_t is in namespace std
    std::size_t i = 5;
+ 
+   std::tm mytime;
+ 
    return 0;
  }
Index: testsuite/17_intro/header_cwctype.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/17_intro/header_cwctype.cc,v
retrieving revision 1.3
diff -c -p -r1.3 header_cwctype.cc
*** header_cwctype.cc	2001/05/12 16:51:41	1.3
--- header_cwctype.cc	2001/06/20 03:03:06
***************
*** 22,32 ****
  
  #if _GLIBCPP_USE_WCHAR_T
  #include <cwctype>
!   // Make sure wint_t is in namespace std
!   std::wint_t i = 5;
  #endif
  
  int main(void)
  {
    return 0;
  }
--- 22,54 ----
  
  #if _GLIBCPP_USE_WCHAR_T
  #include <cwctype>
! // Make sure wint_t is in namespace std
! std::wint_t i = 5;
! 
! // Make sure table 46 is in namespace std.
! using std::wctype_t;
! using std::wctrans_t;
! using std::iswalpha;
! using std::iswupper;
! using std::iswlower;
! using std::iswdigit;
! using std::iswxdigit;
! using std::iswalnum;
! using std::iswspace;
! using std::iswpunct;
! using std::iswprint;
! using std::iswgraph;
! using std::iswcntrl;
! using std::iswctype;
! using std::towctrans;
! using std::towlower;
! using std::towupper;
! using std::wctrans;
! using std::wctype;
  #endif
  
  int main(void)
  {
    return 0;
  }
+ 
Index: testsuite/18_support/numeric_limits.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/18_support/numeric_limits.cc,v
retrieving revision 1.3
diff -c -p -r1.3 numeric_limits.cc
*** numeric_limits.cc	2001/05/12 16:51:41	1.3
--- numeric_limits.cc	2001/06/20 03:03:07
***************
*** 1,6 ****
  // 1999-08-23 bkoz
  
! // Copyright (C) 1999 Free Software Foundation
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
--- 1,6 ----
  // 1999-08-23 bkoz
  
! // Copyright (C) 1999, 2001 Free Software Foundation
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
*************** bool test01()
*** 80,88 ****
    return test;
  }
  
  int main()
  {
    test01();
! 
    return 0;
  }
--- 80,100 ----
    return test;
  }
  
+ // test linkage of the generic bits
+ void test02()
+ {
+   typedef std::numeric_limits<B> b_nl_type;
+   
+   // Should probably do all of them...
+   const int* pi1 = &b_nl_type::digits;
+   const int* pi2 = &b_nl_type::digits10;
+   const int* pi3 = &b_nl_type::max_exponent10;
+   const bool* pb1 = &b_nl_type::traps;
+ }
+ 
  int main()
  {
    test01();
!   test02();
    return 0;
  }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]