aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/mult-abs-2.c
blob: a41f1baf25669a4fd301a586a49ba5e3c5b966ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* { dg-do compile } */
/* { dg-require-effective-target c99_runtime } */
/* { dg-options "-O2 -ffast-math -fdump-tree-gimple" } */

float f(float x)
{
  return x * (x > 0.f ? -1.f : 1.f);
}
float f1(float x)
{
  return x * (x > 0.f ? 1.f : -1.f);
}
float g(float x)
{
  return x * (x >= 0.f ? -1.f : 1.f);
}
float g1(float x)
{
  return x * (x >= 0.f ? 1.f : -1.f);
}
float h(float x)
{
  return x * (x < 0.f ? -1.f : 1.f);
}
float h1(float x)
{
  return x * (x < 0.f ? 1.f : -1.f);
}
float i(float x)
{
  return x * (x <= 0.f ? -1.f : 1.f);
}
float i1(float x)
{
  return x * (x <= 0.f ? 1.f : -1.f);
}
/* { dg-final { scan-tree-dump-times "ABS" 8 "gimple"} } */