aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr89984.c
blob: 471fe92bc86ab25622569cec80e71536f7e60ec3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* PR target/89984 */
/* { dg-do run } */
/* { dg-options "-O2" } */

__attribute__((noipa)) float
foo (float x, float y)
{
  return x * __builtin_copysignf (1.0f, y) + y;
}

int
main ()
{
  if (foo (1.25f, 7.25f) != 1.25f + 7.25f
      || foo (1.75f, -3.25f) != -1.75f + -3.25f
      || foo (-2.25f, 7.5f) != -2.25f + 7.5f
      || foo (-3.0f, -4.0f) != 3.0f + -4.0f)
    __builtin_abort ();
  return 0;
}