]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/ext/special_functions/conf_hyperg/check_nan.cc
Fix dg-require before dg-run directives in testsuite.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / ext / special_functions / conf_hyperg / check_nan.cc
CommitLineData
13cddbc1 1// { dg-do run { target c++11 } }
2be75957
ESR
2// { dg-require-c-std "" }
3// { dg-add-options ieee }
4// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
5
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.
13//
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.
18//
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/>.
22
23// conf_hyperg
24
25#include <cmath>
26#include <testsuite_hooks.h>
27
28void
29test01()
30{
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();
34
35 float cf = 3.0F;
36 double cd = 3.0;
37 long double cl = 3.0L;
38
39 float xf = 0.5F;
40 double xd = 0.5;
41 long double xl = 0.5L;
42
43 float a = __gnu_cxx::conf_hyperg(af, cf, xf);
44 float b = __gnu_cxx::conf_hypergf(af, cf, xf);
45 double c = __gnu_cxx::conf_hyperg(ad, cd, xd);
46 long double d = __gnu_cxx::conf_hyperg(al, cl, xl);
47 long double e = __gnu_cxx::conf_hypergl(al, cl, xl);
48
49 bool test [[gnu::unused]] = true;
50 VERIFY(std::isnan(a));
51 VERIFY(std::isnan(b));
52 VERIFY(std::isnan(c));
53 VERIFY(std::isnan(d));
54 VERIFY(std::isnan(e));
55
56 return;
57}
58
59void
60test02()
61{
62 float af = 2.0F;
63 double ad = 2.0;
64 long double al = 2.0L;
65
66 float cf = std::numeric_limits<float>::quiet_NaN();
67 double cd = std::numeric_limits<double>::quiet_NaN();
68 long double cl = std::numeric_limits<long double>::quiet_NaN();
69
70 float xf = 0.5F;
71 double xd = 0.5;
72 long double xl = 0.5L;
73
74 float a = __gnu_cxx::conf_hyperg(af, cf, xf);
75 float b = __gnu_cxx::conf_hypergf(af, cf, xf);
76 double c = __gnu_cxx::conf_hyperg(ad, cd, xd);
77 long double d = __gnu_cxx::conf_hyperg(al, cl, xl);
78 long double e = __gnu_cxx::conf_hypergl(al, cl, xl);
79
80 bool test [[gnu::unused]] = true;
81 VERIFY(std::isnan(a));
82 VERIFY(std::isnan(b));
83 VERIFY(std::isnan(c));
84 VERIFY(std::isnan(d));
85 VERIFY(std::isnan(e));
86
87 return;
88}
89
90void
91test03()
92{
93 float af = 2.0F;
94 double ad = 2.0;
95 long double al = 2.0L;
96
97 float cf = 3.0F;
98 double cd = 3.0;
99 long double cl = 3.0L;
100
101 float xf = std::numeric_limits<float>::quiet_NaN();
102 double xd = std::numeric_limits<double>::quiet_NaN();
103 long double xl = std::numeric_limits<long double>::quiet_NaN();
104
105 float a = __gnu_cxx::conf_hyperg(af, cf, xf);
106 float b = __gnu_cxx::conf_hypergf(af, cf, xf);
107 double c = __gnu_cxx::conf_hyperg(ad, cd, xd);
108 long double d = __gnu_cxx::conf_hyperg(al, cl, xl);
109 long double e = __gnu_cxx::conf_hypergl(al, cl, xl);
110
111 bool test [[gnu::unused]] = true;
112 VERIFY(std::isnan(a));
113 VERIFY(std::isnan(b));
114 VERIFY(std::isnan(c));
115 VERIFY(std::isnan(d));
116 VERIFY(std::isnan(e));
117
118 return;
119}
120
121int
122main()
123{
124 test01();
125 test02();
126 test03();
127 return 0;
128}
129