blob: 13e20e0cd2ca4023fcd0eabbbe1dfb40729f073d [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O -fnon-call-exceptions -fdump-tree-lim2-details -w" } */
extern volatile int y;
double
foo (double a, int x)
{
while (x--)
{
y++;
a += 1.0 / 0.0;
}
return a;
}
// The expression 1.0 / 0.0 should not be treated as a loop invariant
// if it may throw an exception.
// { dg-final { scan-tree-dump-times "invariant up to" 0 "lim2" } }