S/390: Allow immediates in loc expander
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-8.c
blob1eefccc1a3b1e67b014d54b8d75e973b339a39d2
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
3 /* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-*" } } */
4 /* Load immediate on condition is available from z13 on and prevents moving
5 the load out of the loop, so always run this test with -march=zEC12 that
6 does not have load immediate on condition. */
7 /* { dg-additional-options "-march=zEC12" { target { s390*-*-* } } } */
9 void
10 f (int *a, int *b)
12 int i;
14 for (i = 0; i < 100; i++)
16 int d = 42;
18 a[i] = d;
19 if (i % 2)
20 d = i;
21 b[i] = d;
25 /* Load of 42 is moved out of the loop, introducing a new pseudo register. */
26 /* { dg-final { scan-rtl-dump-times "Decided" 1 "loop2_invariant" } } */
27 /* { dg-final { scan-rtl-dump-not "without introducing a new temporary register" "loop2_invariant" } } */