Fix dg-require before dg-run directives in testsuite.
[official-gcc.git] / libstdc++-v3 / testsuite / ext / special_functions / hyperg / check_nan.cc
blob31b81a693818586afc56f63ff11460eacb35a55a
1 // { dg-do run { target c++11 } }
2 // { dg-require-c-std "" }
3 // { dg-add-options ieee }
4 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
6 // Copyright (C) 2016 Free Software Foundation, Inc.
7 //
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)
12 // any later version.
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 // hyperg
25 #include <cmath>
26 #include <testsuite_hooks.h>
28 void
29 test01()
31 float af = std::numeric_limits<float>::quiet_NaN();
32 double ad = std::numeric_limits<double>::quiet_NaN();
33 long double al = std::numeric_limits<long double>::quiet_NaN();
35 float bf = 10.0F;
36 double bd = 10.0;
37 long double bl = 10.0L;
39 float cf = 3.0F;
40 double cd = 3.0;
41 long double cl = 3.0L;
43 float xf = 0.5F;
44 double xd = 0.5;
45 long double xl = 0.5L;
47 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
48 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
49 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
50 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
51 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
53 bool test [[gnu::unused]] = true;
54 VERIFY(std::isnan(a));
55 VERIFY(std::isnan(b));
56 VERIFY(std::isnan(c));
57 VERIFY(std::isnan(d));
58 VERIFY(std::isnan(e));
60 return;
63 void
64 test02()
66 float af = 2.0F;
67 double ad = 2.0;
68 long double al = 2.0L;
70 float bf = std::numeric_limits<float>::quiet_NaN();
71 double bd = std::numeric_limits<double>::quiet_NaN();
72 long double bl = std::numeric_limits<long double>::quiet_NaN();
74 float cf = 3.0F;
75 double cd = 3.0;
76 long double cl = 3.0L;
78 float xf = 0.5F;
79 double xd = 0.5;
80 long double xl = 0.5L;
82 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
83 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
84 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
85 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
86 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
88 bool test [[gnu::unused]] = true;
89 VERIFY(std::isnan(a));
90 VERIFY(std::isnan(b));
91 VERIFY(std::isnan(c));
92 VERIFY(std::isnan(d));
93 VERIFY(std::isnan(e));
95 return;
98 void
99 test03()
101 float af = 2.0F;
102 double ad = 2.0;
103 long double al = 2.0L;
105 float bf = 10.0F;
106 double bd = 10.0;
107 long double bl = 10.0L;
109 float cf = std::numeric_limits<float>::quiet_NaN();
110 double cd = std::numeric_limits<double>::quiet_NaN();
111 long double cl = std::numeric_limits<long double>::quiet_NaN();
113 float xf = 0.5F;
114 double xd = 0.5;
115 long double xl = 0.5L;
117 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
118 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
119 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
120 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
121 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
123 bool test [[gnu::unused]] = true;
124 VERIFY(std::isnan(a));
125 VERIFY(std::isnan(b));
126 VERIFY(std::isnan(c));
127 VERIFY(std::isnan(d));
128 VERIFY(std::isnan(e));
130 return;
133 void
134 test04()
136 float af = 2.0F;
137 double ad = 2.0;
138 long double al = 2.0L;
140 float bf = 10.0F;
141 double bd = 10.0;
142 long double bl = 10.0L;
144 float cf = 3.0F;
145 double cd = 3.0;
146 long double cl = 3.0L;
148 float xf = std::numeric_limits<float>::quiet_NaN();
149 double xd = std::numeric_limits<double>::quiet_NaN();
150 long double xl = std::numeric_limits<long double>::quiet_NaN();
152 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
153 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
154 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
155 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
156 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
158 bool test [[gnu::unused]] = true;
159 VERIFY(std::isnan(a));
160 VERIFY(std::isnan(b));
161 VERIFY(std::isnan(c));
162 VERIFY(std::isnan(d));
163 VERIFY(std::isnan(e));
165 return;
169 main()
171 test01();
172 test02();
173 test03();
174 test04();
175 return 0;