]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/18_support/type_info/fundamental.cc
1 // { dg-options "-std=gnu++0x" }
2 // { dg-require-effective-target dfp }
4 // 2011-02-23 Benjamin Kosnik <bkoz@redhat.com>
6 // Copyright (C) 2011-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/>.
25 #include <decimal/decimal>
27 template<typename _Tp
>
31 std::string s1
= typeid(_Tp
).name();
32 std::string s2
= typeid(_Tp
*).name();
33 std::string s3
= typeid(const _Tp
*).name();
34 return std::max(std::max(s1
, s2
), s3
);
37 // libstdc++/43622, others
40 gen_type_info
<bool>();
41 gen_type_info
<char>();
42 gen_type_info
<signed char>();
43 gen_type_info
<unsigned char>();
44 gen_type_info
<short>();
45 gen_type_info
<unsigned short>();
47 gen_type_info
<unsigned int>();
48 gen_type_info
<long>();
49 gen_type_info
<unsigned long>();
50 gen_type_info
<long long>();
51 gen_type_info
<unsigned long long>();
52 gen_type_info
<wchar_t>();
53 gen_type_info
<char16_t
>();
54 gen_type_info
<char32_t
>();
56 gen_type_info
<float>();
57 gen_type_info
<double>();
58 gen_type_info
<long double>();
60 gen_type_info
<void>();
62 gen_type_info
<std::nullptr_t
>();
65 gen_type_info
<std::decimal::decimal32
>();
66 gen_type_info
<std::decimal::decimal64
>();
67 gen_type_info
<std::decimal::decimal128
>();
71 typedef int ti_type
__attribute__((__mode__(TI
)));
72 gen_type_info
<ti_type
>();
74 typedef float tf_type
__attribute__((__mode__(TF
)));
75 gen_type_info
<tf_type
>();