1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
4 /* This maps to essentially the same gimple that is generated for
5 gnat.dg/sin_cos.adb, on platforms that use the wraplf variant of
6 Ada.Numerics.Aux_Float. The value of EPSILON is not relevant to
7 the test, but the test must be there to keep the conversions in
8 different BBs long enough to trigger the problem that prevented the
9 sincos optimization, because the arguments passed to sin and cos
10 didn't get unified into a single SSA_NAME in time for sincos. */
14 #define EPSILON 3.4526697709225118160247802734375e-4
16 static float my_sinf(float x
) {
17 return (float) sin ((double) x
);
20 static float wrap_sinf(float x
) {
21 if (fabs (x
) < EPSILON
)
26 static float my_cosf(float x
) {
27 return (float) cos ((double) x
);
30 static float wrap_cosf(float x
) {
31 if (fabs (x
) < EPSILON
)
36 float my_sin_cos(float x
, float *s
, float *c
) {
41 /* { dg-final { scan-assembler "sincos\|cexp" { target *-linux-gnu* *-w64-mingw* *-*-vxworks* } } } */