2014-04-07 Charles Baylis <charles.baylis@linaro.org>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / predcom-1.C
blob9e9a4b38cfa9fc4f2a4d56d0cff46fc8e5b2b6ea
1 /* Test for ICE in predictive commoning with empty loop header block
2    on arm-none-linux-*.  */
4 struct Foo
6   double *ptr;
7   
8   Foo (double *ptr_)
9     : ptr (ptr_)
10   {
11   }
12   
13   Foo PostInc ()
14   {
15     return Foo (ptr++);
16   }
19 bool Baz (Foo first, double *last)
21   Foo prev (first.ptr);
22   
23   first.ptr++;
25   while (first.ptr != last)
26     if (*first.PostInc ().ptr < *prev.PostInc ().ptr)
27       return false;