(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
sve/
struct_vect_23_run.c
       1  /* { dg-do run { target aarch64_sve_hw } } */
       2  /* { dg-options "-O2 -ftree-vectorize" } */
       3  
       4  #include "struct_vect_23.c"
       5  
       6  #define N 1000
       7  
       8  #undef TEST_LOOP
       9  #define TEST_LOOP(NAME, TYPE)			\
      10    {						\
      11      TYPE out[N];				\
      12      TYPE in[N * 4];				\
      13      int counts[] = { 0, 1, N - 1 };		\
      14      for (int j = 0; j < 3; ++j)			\
      15        {						\
      16  	int count = counts[j];			\
      17  	for (int i = 0; i < N; ++i)		\
      18  	  {					\
      19  	    out[i] = i * 7 / 2;			\
      20  	    asm volatile ("" ::: "memory");	\
      21  	  }					\
      22  	for (int i = 0; i < N * 4; ++i)		\
      23  	  {					\
      24  	    in[i] = i * 9 / 2;			\
      25  	    asm volatile ("" ::: "memory");	\
      26  	  }					\
      27  	NAME (out, in, count);			\
      28  	for (int i = 0; i < N; ++i)		\
      29  	  {					\
      30  	    TYPE expected = i * 7 / 2;		\
      31  	    if (i < count)			\
      32  	      expected += in[i * 4];		\
      33  	    if (out[i] != expected)		\
      34  	      __builtin_abort ();		\
      35  	    asm volatile ("" ::: "memory");	\
      36  	  }					\
      37        }						\
      38    }
      39  
      40  int __attribute__ ((optimize (1)))
      41  main (void)
      42  {
      43    TEST (test);
      44    return 0;
      45  }