(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
loop-8.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
       3  /* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-* mmix-*-* vax-*-* loongarch*-*-*" } } */
       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*-*-* } } } */
       8  
       9  void
      10  f (int *a, int *b)
      11  {
      12    int i;
      13  
      14    i = 100;
      15    if (i > 0)
      16      {
      17        do
      18  	{
      19  	  int d = 42;
      20  
      21  	  a[i] = d;
      22  	  if (i % 2)
      23  	    d = i;
      24  	  b[i] = d;
      25  	  ++i;
      26  	}
      27        while (i < 100);
      28      }
      29  }
      30  
      31  /* Load of 42 is moved out of the loop, introducing a new pseudo register.  */
      32  /* { dg-final { scan-rtl-dump-not "without introducing a new temporary register" "loop2_invariant" } } */
      33