1 /* { dg-do compile } */
2 /* { dg-options "-O3" } */
5 check_d_pos (double x
, double y
)
7 return x
* __builtin_copysign (1.0, y
);
11 check_f_pos (float x
, float y
)
13 return x
* __builtin_copysignf (1.0f
, y
);
17 check_l_pos (long double x
, long double y
)
19 return x
* __builtin_copysignl (1.0, y
);
25 check_d_neg (double x
, double y
)
27 return x
* __builtin_copysign (-1.0, y
);
31 check_f_neg (float x
, float y
)
33 return x
* __builtin_copysignf (-1.0f
, y
);
37 check_l_neg (long double x
, long double y
)
39 return x
* __builtin_copysignl (-1.0, y
);
45 check_d_pos_rev (double x
, double y
)
47 return __builtin_copysign (1.0, y
) * x
;
51 check_f_pos_rev (float x
, float y
)
53 return __builtin_copysignf (1.0f
, y
) * x
;
57 check_l_pos_rev (long double x
, long double y
)
59 return __builtin_copysignl (1.0, y
) * x
;
65 check_d_neg_rev (double x
, double y
)
67 return __builtin_copysign (-1.0, y
) * x
;
71 check_f_neg_rev (float x
, float y
)
73 return __builtin_copysignf (-1.0f
, y
) * x
;
77 check_l_neg_rev (long double x
, long double y
)
79 return __builtin_copysignl (-1.0, y
) * x
;
82 /* { dg-final { scan-assembler "\[ \t\]?eor\[ \t\]?" } } */
83 /* { dg-final { scan-assembler "\[ \t\]?and\[ \t\]?" } } */
84 /* { dg-final { scan-assembler-not "copysign" } } */
85 /* { dg-final { scan-assembler-not "\[ \t\]?orr\[ \t\]?" } } */
86 /* { dg-final { scan-assembler-not "\[ \t\]?fmul\[ \t\]?" } } */