* gcc.dg/predict-12.c: New testcase.
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-8.c
blob463c5d0a29a63edf67aaf76e954a5b9c963f0ebc
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
3 /* { dg-skip-if "unexpected IV" { "hppa*-*-* visium-*-*" } { "*" } { "" } } */
5 void
6 f (int *a, int *b)
8 int i;
10 for (i = 0; i < 100; i++)
12 int d = 42;
14 a[i] = d;
15 if (i % 2)
16 d = i;
17 b[i] = d;
21 /* Load of 42 is moved out of the loop, introducing a new pseudo register. */
22 /* { dg-final { scan-rtl-dump-times "Decided" 1 "loop2_invariant" } } */
23 /* { dg-final { scan-rtl-dump-not "without introducing a new temporary register" "loop2_invariant" } } */