blob: ab8c40c48629a3ca8928a85c2816b23eee31d3de [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <math.h>
2
3static int testf(float float_x, long double long_double_x, /*float complex float_complex_x,*/ int int_x, long long_x)
4{
5int r = 0;
6r += acosf(float_x);
7r += acoshf(float_x);
8r += asinf(float_x);
9r += asinhf(float_x);
10r += atan2f(float_x, float_x);
11r += atanf(float_x);
12r += atanhf(float_x);
13/*r += cargf(float_complex_x); - will fight with complex numbers later */
14r += cbrtf(float_x);
15r += ceilf(float_x);
16r += copysignf(float_x, float_x);
17r += cosf(float_x);
18r += coshf(float_x);
19r += erfcf(float_x);
20r += erff(float_x);
21r += exp2f(float_x);
22r += expf(float_x);
23r += expm1f(float_x);
24r += fabsf(float_x);
25/*r += fdimf(float_x, float_x); - uclibc does not have it (yet?) */
26r += floorf(float_x);
27/*r += fmaf(float_x, float_x, float_x); - uclibc does not have it (yet?) */
28/*r += fmaxf(float_x, float_x); - uclibc does not have it (yet?) */
29/*r += fminf(float_x, float_x); - uclibc does not have it (yet?) */
30r += fmodf(float_x, float_x);
31r += frexpf(float_x, &int_x);
32r += gammaf(float_x);
33r += hypotf(float_x, float_x);
34r += ilogbf(float_x);
35r += ldexpf(float_x, int_x);
36r += lgammaf(float_x);
37r += llrintf(float_x);
38r += llroundf(float_x);
39r += log10f(float_x);
40r += log1pf(float_x);
41r += log2f(float_x);
42r += logbf(float_x);
43r += logf(float_x);
44r += lrintf(float_x);
45r += lroundf(float_x);
46r += modff(float_x, &float_x);
47/*r += nearbyintf(float_x); - uclibc does not have it (yet?) */
48/*r += nexttowardf(float_x, long_double_x); - uclibc does not have it (yet?) */
49r += powf(float_x, float_x);
50r += remainderf(float_x, float_x);
51/*r += remquof(float_x, float_x, &int_x); - uclibc does not have it (yet?) */
52r += rintf(float_x);
53r += roundf(float_x);
54#ifdef __UCLIBC_SUSV3_LEGACY__
55r += scalbf(float_x, float_x);
56#endif
57/*r += scalblnf(float_x, long_x); - uclibc does not have it (yet?) */
58r += scalbnf(float_x, int_x);
59r += significandf(float_x);
60r += sinf(float_x);
61r += sinhf(float_x);
62r += sqrtf(float_x);
63r += tanf(float_x);
64r += tanhf(float_x);
65/*r += tgammaf(float_x); - uclibc does not have it (yet?) */
66r += truncf(float_x);
67return r;
68}
69
70static int testl(long double long_double_x, int int_x, long long_x)
71{
72int r = 0;
73r += __finitel(long_double_x);
74r += __fpclassifyl(long_double_x);
75r += __isinfl(long_double_x);
76r += __isnanl(long_double_x);
77r += __signbitl(long_double_x);
78r += acoshl(long_double_x);
79r += acosl(long_double_x);
80r += asinhl(long_double_x);
81r += asinl(long_double_x);
82r += atan2l(long_double_x, long_double_x);
83r += atanhl(long_double_x);
84r += atanl(long_double_x);
85r += cbrtl(long_double_x);
86r += ceill(long_double_x);
87r += copysignl(long_double_x, long_double_x);
88r += coshl(long_double_x);
89r += cosl(long_double_x);
90r += erfcl(long_double_x);
91r += erfl(long_double_x);
92r += exp2l(long_double_x);
93r += expl(long_double_x);
94r += expm1l(long_double_x);
95r += fabsl(long_double_x);
96r += fdiml(long_double_x, long_double_x);
97r += floorl(long_double_x);
98r += fmal(long_double_x, long_double_x, long_double_x);
99r += fmaxl(long_double_x, long_double_x);
100r += fminl(long_double_x, long_double_x);
101r += fmodl(long_double_x, long_double_x);
102r += frexpl(long_double_x, &int_x);
103r += hypotl(long_double_x, long_double_x);
104r += ilogbl(long_double_x);
105r += ldexpl(long_double_x, int_x);
106r += lgammal(long_double_x);
107r += llrintl(long_double_x);
108r += llroundl(long_double_x);
109r += log10l(long_double_x);
110r += log1pl(long_double_x);
111r += log2l(long_double_x);
112r += logbl(long_double_x);
113r += logl(long_double_x);
114r += lrintl(long_double_x);
115r += lroundl(long_double_x);
116r += modfl(long_double_x, &long_double_x);
117r += nearbyintl(long_double_x);
118r += nextafterl(long_double_x, long_double_x);
119/* r += nexttowardl(long_double_x, long_double_x); - uclibc doesn't provide this [yet?] */
120r += powl(long_double_x, long_double_x);
121r += remainderl(long_double_x, long_double_x);
122r += remquol(long_double_x, long_double_x, &int_x);
123r += rintl(long_double_x);
124r += roundl(long_double_x);
125r += scalblnl(long_double_x, long_x);
126r += scalbnl(long_double_x, int_x);
127r += sinhl(long_double_x);
128r += sinl(long_double_x);
129r += sqrtl(long_double_x);
130r += tanhl(long_double_x);
131r += tanl(long_double_x);
132r += tgammal(long_double_x);
133r += truncl(long_double_x);
134return r;
135}
136
137int main(int argc, char **argv)
138{
139 /* Always 0 but gcc hopefully won't be able to notice */
140 return 5 & ((long)&testf) & ((long)&testl) & 2;
141}