(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.target/
aarch64/
sve/
cond_unary_2_run.c
       1  /* { dg-do run { target { aarch64_sve_hw } } } */
       2  /* { dg-options "-O2 -ftree-vectorize" } */
       3  
       4  #include "cond_unary_2.c"
       5  
       6  #define N 99
       7  
       8  #define TEST_LOOP(TYPE, OP)					\
       9    {								\
      10      TYPE r[N], a[N], b[N], pred[N];				\
      11      for (int i = 0; i < N; ++i)					\
      12        {								\
      13  	a[i] = (i & 1 ? i : 3 * i) * (i % 3 == 0 ? 1 : -1);	\
      14  	b[i] = (i % 9) * (i % 7 + 1);				\
      15  	pred[i] = (i % 7 < 4);					\
      16  	asm volatile ("" ::: "memory");				\
      17        }								\
      18      test_##TYPE##_##OP (r, a, b, pred, N);			\
      19      for (int i = 0; i < N; ++i)					\
      20        if (r[i] != (pred[i] ? OP (a[i]) : b[i]))			\
      21  	__builtin_abort ();					\
      22    }
      23  
      24  int main ()
      25  {
      26    TEST_ALL (TEST_LOOP)
      27    return 0;
      28  }