(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
vect-outer-slp-3.c
       1  /* { dg-require-effective-target vect_double } */
       2  /* { dg-require-effective-target vect_intdouble_cvt } */
       3  
       4  #include "tree-vect.h"
       5  
       6  double image[40];
       7  
       8  void __attribute__((noipa))
       9  foo (void)
      10  {
      11    for (int i = 0; i < 20; i++)
      12      {
      13        double suma = 0;
      14        double sumb = 0;
      15        int k = image[2*i];
      16        int l = image[2*i+1];
      17        for (int j = 0; j < 40; j++)
      18          {
      19            suma += k+i;
      20            sumb += l+i;
      21            k++;
      22            l++;
      23          }
      24        image[2*i] = suma;
      25        image[2*i+1] = sumb;
      26      }
      27  }
      28  
      29  int main ()
      30  {
      31    check_vect ();
      32  
      33    for (int i = 0; i < 40; ++i)
      34      image[i] = 1.;
      35  
      36    foo ();
      37  
      38    for (int i = 0; i < 20; i++)
      39      {
      40        double suma = 0;
      41        double sumb = 0;
      42        int k = 1;
      43        int l = 1;
      44        for (int j = 0; j < 40; j++)
      45  	{
      46            suma += k+i;
      47            sumb += l+i;
      48  	  asm ("" : "+g" (suma));
      49  	  asm ("" : "+g" (sumb));
      50            k++;
      51            l++;
      52  	}
      53        if (image[2*i] != suma
      54  	  || image[2*i+1] != sumb)
      55  	abort ();
      56      }
      57  
      58    return 0;
      59  }
      60  
      61  /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" } } */
      62  /* We don't yet support SLP inductions for variable length vectors.  */
      63  /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { xfail vect_variable_length } } } */