Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr33615-2.C
blob542731a606d219b8a55f72b01fa18da2b1a918e7
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fnon-call-exceptions -fdump-tree-pre-details -w" } */
4 extern volatile int y;
6 double
7 foo (double a, int x)
9   while (x--)
10     {
11       y++;
12       a += 1.0 / 0.0;
13     }
14   return a;
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 "Replaced 1\\\.0e\\\+0 / 0\\\.0" 0 "pre" } }
20 // { dg-final { cleanup-tree-dump "pre" } }