2 /* { dg-options "-O2 --save-temps" } */
7 check (double x
, double y
)
9 return __builtin_copysign (x
, y
);
15 return __builtin_copysign (x
, 1.0);
21 return __builtin_copysign (1.0, x
);
27 return -__builtin_copysign (x
, 1.0);
31 check4 (double x
, double y
)
33 return x
* __builtin_copysign (x
, y
);
37 check5 (double x
, double y
)
39 return __builtin_copysign (-x
, -y
);
43 main (int argc
, char** argv
)
47 double epsilon
= 0.00001;
49 double expected
= -2.0;
51 if (fabs (check (x
, y
) - expected
) >= epsilon
)
56 if (fabs (check1 (x
) - expected
) >= epsilon
)
61 if (fabs (check2 (x
) - expected
) >= epsilon
)
66 if (fabs (check3 (x
) - expected
) >= epsilon
)
71 if (fabs (check4 (x
, y
) - expected
) >= epsilon
)
76 if (fabs (check5 (x
, y
) - expected
) >= epsilon
)
80 /* { dg-final { scan-assembler-not "copysign\tw" } } */