Debian Codegraph @

gcc/testsuite/gcc.dg/fold-copysign-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-cddce1" } */
3 /* { dg-additional-options "-msse -mfpmath=sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
4 /* { dg-additional-options "-mdouble=64" { target { avr-*-* } } } */
5
6 double foo (double x)
7 {
8 double one = 1.;
9 return __builtin_copysign (x, one);
10 }
11 double bar (double x)
12 {
13 double minuszero = -0.;
14 return __builtin_copysign (x, minuszero);
15 }
16
17 /* { dg-final { scan-tree-dump-times "__builtin_copysign" 1 "cddce1" { target ifn_copysign } } } */
18 /* { dg-final { scan-tree-dump-times "= ABS_EXPR" 1 "cddce1" { target ifn_copysign } } } */
19 /* { dg-final { scan-tree-dump-times "= -" 1 "cddce1" { target { ! ifn_copysign } } } } */
20 /* { dg-final { scan-tree-dump-times "= ABS_EXPR" 2 "cddce1" { target { ! ifn_copysign } } } } */