| 1 |
/* PR target/104612 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
/* { dg-additional-options "-msse2 -mfpmath=sse" { target i?86-*-* x86_64-*-* } } */ |
| 5 |
|
| 6 |
struct V { float x, y; }; |
| 7 |
|
| 8 |
struct V |
| 9 |
foo (struct V v) |
| 10 |
{ |
| 11 |
struct V ret; |
| 12 |
ret.x = __builtin_copysignf (1.0e+0, v.x); |
| 13 |
ret.y = __builtin_copysignf (1.0e+0, v.y); |
| 14 |
return ret; |
| 15 |
} |
| 16 |
|
| 17 |
float |
| 18 |
bar (struct V v) |
| 19 |
{ |
| 20 |
return __builtin_copysignf (v.x, v.y); |
| 21 |
} |
| 22 |
|
| 23 |
float |
| 24 |
baz (struct V v) |
| 25 |
{ |
| 26 |
return v.x * __builtin_copysignf (1.0f, v.y); |
| 27 |
} |