(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
vect/
pr62021.c
       1  /* { dg-require-effective-target vect_simd_clones } */
       2  /* { dg-additional-options "-fopenmp-simd" } */
       3  /* { dg-additional-options "-mavx" { target avx_runtime } } */
       4  
       5  #include "tree-vect.h"
       6  
       7  #pragma omp declare simd linear(y)
       8  __attribute__((noinline)) int *
       9  foo (int *x, int y)
      10  {
      11    return x + y;
      12  }
      13  
      14  int a[1024];
      15  int *b[1024] = { &a[0] };
      16  
      17  int
      18  main ()
      19  {
      20    int i;
      21    check_vect ();
      22    for (i = 0; i < 1024; i++)
      23      b[i] = &a[1023 - i];
      24    #pragma omp simd
      25    for (i = 0; i < 1024; i++)
      26      b[i] = foo (b[i], i);
      27    for (i = 0; i < 1024; i++)
      28      if (b[i] != &a[1023])
      29        __builtin_abort ();
      30    return 0;
      31  }
      32