]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++11.cc
1 // Copyright (C) 2010-2019 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do compile { target c++11 } }
19 // { dg-excess-errors "" { target uclibc } }
37 void isgreaterequal() { }
41 void islessequal() { }
43 void islessgreater() { }
45 void isunordered() { }
47 #if _GLIBCXX_USE_C99_MATH
48 template <typename _Tp
, typename _Up
= _Tp
>
49 void test_c99_classify()
51 typedef _Tp fp_type_one
;
52 typedef _Up fp_type_two
;
58 resi
= std::fpclassify(f1
);
59 res
= std::isfinite(f2
);
62 res
= std::isnormal(f1
);
63 res
= std::signbit(f2
);
64 res
= std::isgreater(f1
, f2
);
65 res
= std::isgreaterequal(f1
, f2
);
66 res
= std::isless(f1
, f2
);
67 res
= std::islessequal(f1
,f2
);
68 res
= std::islessgreater(f1
, f2
);
69 res
= std::isunordered(f1
, f2
);
70 resi
= resi
; // Suppress unused warning.
77 #if _GLIBCXX_USE_C99_MATH
78 test_c99_classify
<float>();
79 test_c99_classify
<double>();
80 test_c99_classify
<long double>();
81 test_c99_classify
<float, double>();
82 test_c99_classify
<float, long double>();
83 test_c99_classify
<double, float>();
84 test_c99_classify
<double, long double>();
85 test_c99_classify
<long double, float>();
86 test_c99_classify
<long double, double>();