1 /* { dg-do run { target c99_runtime } } */
2 /* { dg-options "-Ofast" } */
3 /* { dg-add-options ieee } */
5 extern float sinf (float);
6 extern float cosf (float);
7 extern float atanf (float);
8 extern float sqrtf (float);
9 extern float nextafterf (float, float);
10 extern double sin (double);
11 extern double cos (double);
12 extern double atan (double);
13 extern double sqrt (double);
14 extern double nextafter (double, double);
15 extern long double sinl (long double);
16 extern long double cosl (long double);
17 extern long double atanl (long double);
18 extern long double sqrtl (long double);
19 extern long double nextafterl (long double, long double);
23 double __attribute__ ((noinline
, optimize("Ofast")))
26 return sin (atan (x
));
29 double __attribute__ ((noinline
, optimize("Ofast")))
32 return cos (atan (x
));
35 float __attribute__ ((noinline
, optimize("Ofast")))
38 return sinf (atanf (x
));
41 float __attribute__ ((noinline
, optimize("Ofast")))
44 return cosf (atanf (x
));
47 long double __attribute__ ((noinline
, optimize("Ofast")))
48 sinatanl (long double x
)
50 return sinl (atanl (x
));
53 long double __attribute__ ((noinline
, optimize("Ofast")))
54 cosatanl (long double x
)
56 return cosl (atanl (x
));
62 /* Get first x such that 1 + x*x will overflow */
63 float fc
= nextafterf (sqrtf (__FLT_MAX__
- 1), __FLT_MAX__
);
64 double c
= nextafter (sqrt (__DBL_MAX__
- 1), __DBL_MAX__
);
65 long double lc
= nextafterl (sqrtl (__LDBL_MAX__
- 1), __LDBL_MAX__
);
67 /* Force move from FPU to memory, otherwise comparison may
68 fail due to possible more accurate registers (see 387) */
71 volatile long double ly
;
77 if (fy
!= 1.f
|| y
!= 1 || ly
!= 1.L
)
84 if (fy
!= 0.f
|| y
!= 0. || ly
!= 0.L
)
91 if (fy
!= -1.f
|| y
!= -1. || ly
!= -1.L
)
98 if (fy
!= 0.f
|| y
!= 0. || ly
!= 0.L
)