mips.exp (setup_mips_tests): Set mips_abi to the default ABI.
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / predcom-5.c
blob134fc3765dc8d2f07eedf8038b803a47be4dd37d
1 /* { dg-do compile } */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
5 /* Test for predictive commoning of expressions, with reassociation. */
7 void abort (void);
9 unsigned a[1000], b[1000], c[1000], d[1000];
11 int main(void)
13 unsigned i;
15 for (i = 0; i < 1000; i++)
16 a[i] = b[i] = d[i] = i;
18 for (i = 1; i < 998; i++)
19 c[i] = d[i + 1] * a[i + 2] * b[i + 1] - b[i - 1] * a[i] * d[i - 1];
21 for (i = 1; i < 998; i++)
22 if (c[i] != (i+1)*(i+2)*(i+1) - (i - 1) * i * (i - 1))
23 abort ();
25 return 0;
28 /* { dg-final { scan-tree-dump-times "Combination" 2 "pcom"} } */
29 /* { dg-final { scan-tree-dump-times "Unrolling 3 times." 1 "pcom"} } */
30 /* { dg-final { cleanup-tree-dump "pcom" } } */