summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/pr71078-1.c
blob: 6204c148ec36de928eb3d14d4ac75e1fbb8c6290 (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
/* { dg-do compile } */
/* { dg-options "-O2 -ffast-math -fdump-tree-forwprop-details" } */

#include <math.h>

float f1(float x)
{
  float t1 = fabsf (x);
  float t2 = x / t1;
  return t2;
}
 
double f2(double x)
{
  double t1 = fabs (x);
  double t2 = x / t1;
  return t2;
}

long double f3 (long double x)
{
  long double t1 = fabsl (x);
  long double t2 = x / t1;
  return t2;
}

/* { dg-final { scan-tree-dump "__builtin_copysignf" "forwprop1" } } */
/* { dg-final { scan-tree-dump "__builtin_copysign" "forwprop1" } } */
/* { dg-final { scan-tree-dump "__builtin_copysignl" "forwprop1" } } */