]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc
b3b52bbb42c6663a7cb6f35351b4caf61f8fb6ca
1 // { dg-options "-std=gnu++0x" }
2 // { dg-require-cstdint "" }
4 // 2008-05-20 Paolo Carlini <paolo.carlini@oracle.com>
6 // Copyright (C) 2008-2013 Free Software Foundation, Inc.
8 // This file is part of the GNU ISO C++ Library. This library is free
9 // software; you can redistribute it and/or modify it under the
10 // terms of the GNU General Public License as published by the
11 // Free Software Foundation; either version 3, or (at your option)
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
19 // You should have received a copy of the GNU General Public License along
20 // with this library; see the file COPYING3. If not see
21 // <http://www.gnu.org/licenses/>.
23 // 18.2.1.1 template class numeric_limits
27 #include <testsuite_hooks.h>
29 // Test specializations for char16_t and char32_t, in C++0x.
30 template<typename T
, typename R
>
34 bool test
__attribute__((unused
)) = true;
36 typedef std::numeric_limits
<T
> char_type
;
37 typedef std::numeric_limits
<R
> impl_type
;
39 VERIFY( char_type::is_specialized
== impl_type::is_specialized
);
40 VERIFY( char_type::min() == impl_type::min() );
41 VERIFY( char_type::max() == impl_type::max() );
42 VERIFY( char_type::digits
== impl_type::digits
);
43 VERIFY( char_type::digits10
== impl_type::digits10
);
44 VERIFY( char_type::is_signed
== impl_type::is_signed
);
45 VERIFY( char_type::is_integer
== impl_type::is_integer
);
46 VERIFY( char_type::is_exact
== impl_type::is_exact
);
47 VERIFY( char_type::radix
== impl_type::radix
);
48 VERIFY( char_type::epsilon() == impl_type::epsilon() );
49 VERIFY( char_type::round_error() == impl_type::round_error() );
50 VERIFY( char_type::min_exponent
== impl_type::min_exponent
);
51 VERIFY( char_type::min_exponent10
== impl_type::min_exponent10
);
52 VERIFY( char_type::max_exponent
== impl_type::max_exponent
);
53 VERIFY( char_type::max_exponent10
== impl_type::max_exponent10
);
54 VERIFY( char_type::has_infinity
== impl_type::has_infinity
);
55 VERIFY( char_type::has_quiet_NaN
== impl_type::has_quiet_NaN
);
56 VERIFY( char_type::has_signaling_NaN
== impl_type::has_signaling_NaN
);
57 VERIFY( char_type::has_denorm
== impl_type::has_denorm
);
58 VERIFY( char_type::has_denorm_loss
== impl_type::has_denorm_loss
);
59 VERIFY( char_type::infinity() == impl_type::infinity() );
60 VERIFY( char_type::quiet_NaN() == impl_type::quiet_NaN() );
61 VERIFY( char_type::signaling_NaN() == impl_type::signaling_NaN() );
62 VERIFY( char_type::denorm_min() == impl_type::denorm_min() );
63 VERIFY( char_type::is_iec559
== impl_type::is_iec559
);
64 VERIFY( char_type::is_bounded
== impl_type::is_bounded
);
65 VERIFY( char_type::is_modulo
== impl_type::is_modulo
);
66 VERIFY( char_type::traps
== impl_type::traps
);
67 VERIFY( char_type::tinyness_before
== impl_type::tinyness_before
);
68 VERIFY( char_type::round_style
== impl_type::round_style
);
73 do_test
<char16_t
, uint_least16_t>();
74 do_test
<char32_t
, uint_least32_t>();