aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/tree-ssa/pr20139.c
blob: 016ad004ee8939221e995cef58a5bc64a6163340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* PR tree-optimization/20139
   This testcase is derived from gcc.dg/20020720-1.c.  Here we check
   that the optimization happens at tree level.  */

/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-optimized" } */

extern double fabs (double);
extern void link_error (void);

void
foo (double x)
{
  double p, q;

  p = fabs (x);
  q = 0.0;
  if (p < q)
    link_error ();
}

/* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */