OSDN Git Service

4b075428290442a96662f50945d5bc62b7253e74
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / tree-ssa / pr33615.C
1 /* { dg-do compile } */
2 /* { dg-options "-O -fnon-call-exceptions -fdump-tree-lim-details -w" } */
3
4 extern volatile int y;
5
6 double
7 foo (double a, int x)
8 {
9   while (x--)
10     {
11       y++;
12       a += 1.0 / 0.0;
13     }
14   return a;
15 }
16
17 // The expression 1.0 / 0.0 should not be treated as a loop invariant
18 // if it may throw an exception.
19 // { dg-final { scan-tree-dump-times "invariant up to" 0 "lim1" } }
20 // { dg-final { cleanup-tree-dump "lim\[1-2\]" } }