]>
Commit | Line | Data |
---|---|---|
2c2f70e1 UB |
1 | /* { dg-do link } */ |
2 | /* { dg-options "-O2 -ffast-math" } */ | |
f94bdf2b | 3 | /* { dg-require-effective-target c99_runtime } */ |
2c2f70e1 UB |
4 | |
5 | extern int ilogbf (float); | |
6 | extern float logbf (float); | |
7 | extern int ilogb (double); | |
8 | extern double logb (double); | |
9 | extern int ilogbl (long double); | |
10 | extern long double logbl (long double); | |
11 | ||
12 | extern void link_error(void); | |
13 | ||
14 | void testf(float x) | |
15 | { | |
16 | if ((int) logbf (x) != ilogbf (x)) | |
17 | link_error (); | |
18 | } | |
19 | ||
20 | void test(double x) | |
21 | { | |
22 | if ((int) logb (x) != ilogb (x)) | |
23 | link_error (); | |
24 | } | |
25 | ||
26 | void testl(long double x) | |
27 | { | |
28 | if ((int) logbl (x) != ilogbl (x)) | |
29 | link_error (); | |
30 | } | |
31 | ||
32 | int main() | |
33 | { | |
34 | testf (2.0f); | |
35 | test (2.0); | |
36 | testl (2.0l); | |
37 | ||
38 | return 0; | |
39 | } | |
40 |