aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/vrp-float-11.c
blob: 2f4dc8757a3b1ad213b8291ce967aa03534d0cf1 (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
// { dg-do compile }
// { dg-options "-O2 -fno-thread-jumps -fdump-tree-evrp" }

extern void link_error ();

void fast_sqrt (float);

float test (float x)
{
  float y = x*x;
  if (y >= 0.f)
    { 
      if (__builtin_isnan (y))
	link_error ();
      else
	fast_sqrt (y);

      if (!__builtin_isnan (y))
	fast_sqrt (y);
      else
	link_error ();
    }
}

// { dg-final { scan-tree-dump-times "fast_sqrt" 2 "evrp" } }
// { dg-final { scan-tree-dump-not "link_error" "evrp" } }