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