(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
slp-49.c
       1  /* { dg-require-effective-target vect_int } */
       2  
       3  #include "tree-vect.h"
       4  
       5  int a[1024];
       6  
       7  void __attribute__((noipa))
       8  foo(int k)
       9  {
      10    int j = 5;
      11    for (int i = 0; i < 512; ++i)
      12      {
      13        a[2*i] = j;
      14        a[2*i+1] = k;
      15        j++;
      16        k+=3;
      17      }
      18  }
      19  
      20  int
      21  main()
      22  {
      23    check_vect ();
      24  
      25    foo (17);
      26  
      27    for (int i = 0; i < 512; ++i)
      28      {
      29        if (a[2*i] != 5 + i
      30  	  || a[2*i+1] != 17 + 3 * i)
      31  	__builtin_abort ();
      32      }
      33  
      34    return 0;
      35  }
      36  
      37  /* We don't yet support SLP inductions for variable length vectors.  */
      38  /* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" { xfail vect_variable_length } } } */
      39  /* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */