gcc/testsuite/gcc.dg/tree-ssa/pr20139.c
raw| 1 | /* PR tree-optimization/20139 |
| 2 | This testcase is derived from gcc.dg/20020720-1.c. Here we check |
| 3 | that the optimization happens at tree level. */ |
| 4 | |
| 5 | /* { dg-do compile } */ |
| 6 | /* { dg-options "-O2 -fdump-tree-optimized" } */ |
| 7 | |
| 8 | extern double fabs (double); |
| 9 | extern void link_error (void); |
| 10 | |
| 11 | void |
| 12 | foo (double x) |
| 13 | { |
| 14 | double p, q; |
| 15 | |
| 16 | p = fabs (x); |
| 17 | q = 0.0; |
| 18 | if (p < q) |
| 19 | link_error (); |
| 20 | } |
| 21 | |
| 22 | /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */ |