summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/fold-copysign-1.c
blob: f17d65c24ee4dca9867827d040fe0a404c515e7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-cddce1" } */

double foo (double x)
{
  double one = 1.;
  return __builtin_copysign (x, one);
}
double bar (double x)
{
  double minuszero = -0.;
  return __builtin_copysign (x, minuszero);
}

/* { dg-final { scan-tree-dump-times "= -" 1 "cddce1" } } */
/* { dg-final { scan-tree-dump-times "= ABS_EXPR" 2 "cddce1" } } */