]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/functions.cc
Update copyright years in libstdc++-v3/
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / tr1 / 8_c_compatibility / cmath / functions.cc
1 // { dg-do compile }
2
3 // 2006-02-07 Paolo Carlini <pcarlini@suse.de>
4 //
5 // Copyright (C) 2006-2014 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.
12 //
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.
17 //
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/>.
21
22 // 8.16 Additions to header <cmath>
23
24 #include <tr1/cmath>
25
26 void test01()
27 {
28 #if _GLIBCXX_USE_C99_MATH_TR1
29
30 double d0 = 0.0;
31 float f0 = 0.0f;
32 long double ld0 = 0.0l;
33 const char* str = "NAN";
34 int* pquo = 0;
35 long lex = 0l;
36 int ex = 0;
37
38 double ret;
39 float fret;
40 long double ldret;
41 int iret;
42 long lret;
43 long long llret;
44
45 ret = std::tr1::acosh(d0);
46 fret = std::tr1::acoshf(f0);
47 ldret = std::tr1::acoshl(ld0);
48
49 ret = std::tr1::asinh(d0);
50 fret = std::tr1::asinhf(f0);
51 ldret = std::tr1::asinhl(ld0);
52
53 ret = std::tr1::atanh(d0);
54 fret = std::tr1::atanhf(f0);
55 ldret = std::tr1::atanhl(ld0);
56
57 ret = std::tr1::cbrt(d0);
58 fret = std::tr1::cbrtf(f0);
59 ldret = std::tr1::cbrtl(ld0);
60
61 ret = std::tr1::copysign(d0, d0);
62 fret = std::tr1::copysignf(f0, f0);
63 ldret = std::tr1::copysignl(ld0, ld0);
64
65 ret = std::tr1::erf(d0);
66 fret = std::tr1::erff(f0);
67 ldret = std::tr1::erfl(ld0);
68
69 ret = std::tr1::erfc(d0);
70 fret = std::tr1::erfcf(f0);
71 ldret = std::tr1::erfcl(ld0);
72
73 ret = std::tr1::exp2(d0);
74 fret = std::tr1::exp2f(f0);
75 ldret = std::tr1::exp2l(ld0);
76
77 ret = std::tr1::expm1(d0);
78 fret = std::tr1::expm1f(f0);
79 ldret = std::tr1::expm1l(ld0);
80
81 ret = std::tr1::fdim(d0, d0);
82 fret = std::tr1::fdimf(f0, f0);
83 ldret = std::tr1::fdiml(ld0, ld0);
84
85 ret = std::tr1::fma(d0, d0, d0);
86 fret = std::tr1::fmaf(f0, f0, f0);
87 ldret = std::tr1::fmal(ld0, ld0, ld0);
88
89 ret = std::tr1::fmax(d0, d0);
90 fret = std::tr1::fmaxf(f0, f0);
91 ldret = std::tr1::fmaxl(ld0, ld0);
92
93 ret = std::tr1::fmin(d0, d0);
94 fret = std::tr1::fminf(f0, f0);
95 ldret = std::tr1::fminl(ld0, ld0);
96
97 ret = std::tr1::hypot(d0, d0);
98 fret = std::tr1::hypotf(f0, f0);
99 ldret = std::tr1::hypotl(ld0, ld0);
100
101 iret = std::tr1::ilogb(d0);
102 iret = std::tr1::ilogbf(f0);
103 iret = std::tr1::ilogbl(ld0);
104
105 ret = std::tr1::lgamma(d0);
106 fret = std::tr1::lgammaf(f0);
107 ldret = std::tr1::lgammal(ld0);
108
109 llret = std::tr1::llrint(d0);
110 llret = std::tr1::llrintf(f0);
111 llret = std::tr1::llrintl(ld0);
112
113 llret = std::tr1::llround(d0);
114 llret = std::tr1::llroundf(f0);
115 llret = std::tr1::llroundl(ld0);
116
117 ret = std::tr1::log1p(d0);
118 fret = std::tr1::log1pf(f0);
119 ldret = std::tr1::log1pl(ld0);
120
121 ret = std::tr1::log2(d0);
122 fret = std::tr1::log2f(f0);
123 ldret = std::tr1::log2l(ld0);
124
125 ret = std::tr1::logb(d0);
126 fret = std::tr1::logbf(f0);
127 ldret = std::tr1::logbl(ld0);
128
129 lret = std::tr1::lrint(d0);
130 lret = std::tr1::lrintf(f0);
131 lret = std::tr1::lrintl(ld0);
132
133 lret = std::tr1::lround(d0);
134 lret = std::tr1::lroundf(f0);
135 lret = std::tr1::lroundl(ld0);
136
137 ret = std::tr1::nan(str);
138 fret = std::tr1::nanf(str);
139 ldret = std::tr1::nanl(str);
140
141 ret = std::tr1::nearbyint(d0);
142 fret = std::tr1::nearbyintf(f0);
143 ldret = std::tr1::nearbyintl(ld0);
144
145 ret = std::tr1::nextafter(d0, d0);
146 fret = std::tr1::nextafterf(f0, f0);
147 ldret = std::tr1::nextafterl(ld0, ld0);
148
149 ret = std::tr1::nexttoward(d0, ld0);
150 fret = std::tr1::nexttowardf(f0, ld0);
151 ldret = std::tr1::nexttowardl(ld0, ld0);
152
153 ret = std::tr1::remainder(d0, d0);
154 fret = std::tr1::remainderf(f0, f0);
155 ldret = std::tr1::remainderl(ld0, ld0);
156
157 ret = std::tr1::remquo(d0, d0, pquo);
158 fret = std::tr1::remquof(f0, f0, pquo);
159 ldret = std::tr1::remquol(ld0, ld0, pquo);
160
161 ret = std::tr1::rint(d0);
162 fret = std::tr1::rintf(f0);
163 ldret = std::tr1::rintl(ld0);
164
165 ret = std::tr1::round(d0);
166 fret = std::tr1::roundf(f0);
167 ldret = std::tr1::roundl(ld0);
168
169 ret = std::tr1::scalbln(d0, lex);
170 fret = std::tr1::scalblnf(f0, lex);
171 ldret = std::tr1::scalblnl(ld0, lex);
172
173 ret = std::tr1::scalbn(d0, ex);
174 fret = std::tr1::scalbnf(f0, ex);
175 ldret = std::tr1::scalbnl(ld0, ex);
176
177 ret = std::tr1::tgamma(d0);
178 fret = std::tr1::tgammaf(f0);
179 ldret = std::tr1::tgammal(ld0);
180
181 ret = std::tr1::trunc(d0);
182 fret = std::tr1::truncf(f0);
183 ldret = std::tr1::truncl(ld0);
184
185 ret = ret; // Suppress unused warnings.
186 iret = iret;
187 lret = lret;
188 llret = llret;
189 fret = fret;
190 ldret = ldret;
191
192 #endif
193 }