2016-01-14 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / libstdc++-v3 / testsuite / ext / special_functions / hyperg / check_nan.cc
blobba381ca38034daf5f96b3175dd46d77e6312ed56
1 // { dg-require-c-std "" }
2 // { dg-add-options ieee }
3 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
5 // Copyright (C) 2016 Free Software Foundation, Inc.
6 //
7 // This file is part of the GNU ISO C++ Library. This library is free
8 // software; you can redistribute it and/or modify it under the
9 // terms of the GNU General Public License as published by the
10 // Free Software Foundation; either version 3, or (at your option)
11 // any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License along
19 // with this library; see the file COPYING3. If not see
20 // <http://www.gnu.org/licenses/>.
22 // hyperg
24 #include <cmath>
25 #include <testsuite_hooks.h>
27 void
28 test01()
30 float af = std::numeric_limits<float>::quiet_NaN();
31 double ad = std::numeric_limits<double>::quiet_NaN();
32 long double al = std::numeric_limits<long double>::quiet_NaN();
34 float bf = 10.0F;
35 double bd = 10.0;
36 long double bl = 10.0L;
38 float cf = 3.0F;
39 double cd = 3.0;
40 long double cl = 3.0L;
42 float xf = 0.5F;
43 double xd = 0.5;
44 long double xl = 0.5L;
46 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
47 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
48 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
49 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
50 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
52 bool test [[gnu::unused]] = true;
53 VERIFY(std::isnan(a));
54 VERIFY(std::isnan(b));
55 VERIFY(std::isnan(c));
56 VERIFY(std::isnan(d));
57 VERIFY(std::isnan(e));
59 return;
62 void
63 test02()
65 float af = 2.0F;
66 double ad = 2.0;
67 long double al = 2.0L;
69 float bf = std::numeric_limits<float>::quiet_NaN();
70 double bd = std::numeric_limits<double>::quiet_NaN();
71 long double bl = std::numeric_limits<long double>::quiet_NaN();
73 float cf = 3.0F;
74 double cd = 3.0;
75 long double cl = 3.0L;
77 float xf = 0.5F;
78 double xd = 0.5;
79 long double xl = 0.5L;
81 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
82 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
83 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
84 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
85 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
87 bool test [[gnu::unused]] = true;
88 VERIFY(std::isnan(a));
89 VERIFY(std::isnan(b));
90 VERIFY(std::isnan(c));
91 VERIFY(std::isnan(d));
92 VERIFY(std::isnan(e));
94 return;
97 void
98 test03()
100 float af = 2.0F;
101 double ad = 2.0;
102 long double al = 2.0L;
104 float bf = 10.0F;
105 double bd = 10.0;
106 long double bl = 10.0L;
108 float cf = std::numeric_limits<float>::quiet_NaN();
109 double cd = std::numeric_limits<double>::quiet_NaN();
110 long double cl = std::numeric_limits<long double>::quiet_NaN();
112 float xf = 0.5F;
113 double xd = 0.5;
114 long double xl = 0.5L;
116 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
117 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
118 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
119 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
120 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
122 bool test [[gnu::unused]] = true;
123 VERIFY(std::isnan(a));
124 VERIFY(std::isnan(b));
125 VERIFY(std::isnan(c));
126 VERIFY(std::isnan(d));
127 VERIFY(std::isnan(e));
129 return;
132 void
133 test04()
135 float af = 2.0F;
136 double ad = 2.0;
137 long double al = 2.0L;
139 float bf = 10.0F;
140 double bd = 10.0;
141 long double bl = 10.0L;
143 float cf = 3.0F;
144 double cd = 3.0;
145 long double cl = 3.0L;
147 float xf = std::numeric_limits<float>::quiet_NaN();
148 double xd = std::numeric_limits<double>::quiet_NaN();
149 long double xl = std::numeric_limits<long double>::quiet_NaN();
151 float a = __gnu_cxx::hyperg(af, bf, cf, xf);
152 float b = __gnu_cxx::hypergf(af, bf, cf, xf);
153 double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
154 long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
155 long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
157 bool test [[gnu::unused]] = true;
158 VERIFY(std::isnan(a));
159 VERIFY(std::isnan(b));
160 VERIFY(std::isnan(c));
161 VERIFY(std::isnan(d));
162 VERIFY(std::isnan(e));
164 return;
168 main()
170 test01();
171 test02();
172 test03();
173 test04();
174 return 0;