(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
loop-unswitch-9.c
       1  /* { dg-do compile } */
       2  /* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-optimized" } */
       3  
       4  int
       5  foo(double *a, double *b, double *c, double *d, double *r, int size, int order)
       6  {
       7    for (int i = 0; i < size; i++)
       8    {
       9      double tmp;
      10  
      11      if (order == 1)
      12        tmp = -8 * a[i];
      13      else
      14        {
      15  	if (order == 2)
      16  	  tmp = -4 * b[i];
      17  	else
      18  	  tmp = a[i];
      19        }
      20  
      21      r[i] = 3.4f * tmp + d[i];
      22    }
      23  
      24    return 0;
      25  }
      26  
      27  /* { dg-final { scan-tree-dump-times "unswitching loop . on .if. with condition: order" 2 "unswitch" } } */