]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/18_support/type_info/fundamental.cc
1 // { dg-do run { target c++11 } }
2 // { dg-require-effective-target dfp }
3 // { dg-require-effective-target rtti }
5 // 2011-02-23 Benjamin Kosnik <bkoz@redhat.com>
7 // Copyright (C) 2011-2023 Free Software Foundation, Inc.
9 // This file is part of the GNU ISO C++ Library. This library is free
10 // software; you can redistribute it and/or modify it under the
11 // terms of the GNU General Public License as published by the
12 // Free Software Foundation; either version 3, or (at your option)
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
20 // You should have received a copy of the GNU General Public License along
21 // with this library; see the file COPYING3. If not see
22 // <http://www.gnu.org/licenses/>.
26 #include <decimal/decimal>
28 template<typename _Tp
>
32 std::string s1
= typeid(_Tp
).name();
33 std::string s2
= typeid(_Tp
*).name();
34 std::string s3
= typeid(const _Tp
*).name();
35 return std::max(std::max(s1
, s2
), s3
);
38 // libstdc++/43622, others
41 gen_type_info
<bool>();
42 gen_type_info
<char>();
43 gen_type_info
<signed char>();
44 gen_type_info
<unsigned char>();
45 gen_type_info
<short>();
46 gen_type_info
<unsigned short>();
48 gen_type_info
<unsigned int>();
49 gen_type_info
<long>();
50 gen_type_info
<unsigned long>();
51 gen_type_info
<long long>();
52 gen_type_info
<unsigned long long>();
53 gen_type_info
<wchar_t>();
54 #ifdef _GLIBCXX_USE_CHAR8_T
55 gen_type_info
<char8_t
>();
57 gen_type_info
<char16_t
>();
58 gen_type_info
<char32_t
>();
60 gen_type_info
<float>();
61 gen_type_info
<double>();
62 gen_type_info
<long double>();
64 gen_type_info
<void>();
66 gen_type_info
<std::nullptr_t
>();
69 gen_type_info
<std::decimal::decimal32
>();
70 gen_type_info
<std::decimal::decimal64
>();
71 gen_type_info
<std::decimal::decimal128
>();
75 typedef int ti_type
__attribute__((__mode__(TI
)));
76 gen_type_info
<ti_type
>();
78 typedef float tf_type
__attribute__((__mode__(TF
)));
79 gen_type_info
<tf_type
>();