1 /* PR tree-optimization/19828 */
2 /* { dg-do compile } */
3 /* { dg-options "-O1 -fdump-tree-lim-details" } */
5 int cst_fun1 (int) __attribute__((__const__
));
6 int cst_fun2 (int) __attribute__((__const__
));
7 int pure_fun1 (int) __attribute__((__pure__
));
8 int pure_fun2 (int) __attribute__((__pure__
));
13 int i
, k
= foo (), x
= 0;
15 for (i
= 0; i
< 100; i
++)
30 /* Calls to cst_fun1 and pure_fun1 may be moved out of the loop.
31 Calls to cst_fun2 and pure_fun2 should not be, since calling
32 with k = 0 may be invalid. */
34 /* { dg-final { scan-tree-dump-times "Moving statement" 3 "lim" } } */
35 /* { dg-final { cleanup-tree-dump "lim" } } */