1  /* { dg-do run { target aarch64_sve_hw } } */
       2  /* { dg-options "-O2 -ftree-vectorize --param aarch64-sve-compare-costs=0" } */
       3  
       4  #include "cond_arith_3.c"
       5  
       6  #define N 99
       7  
       8  #undef TEST
       9  #define TEST(TYPE, NAME, OP)					\
      10    {								\
      11      TYPE x[N], y[N], z[N], pred[N];				\
      12      for (int i = 0; i < N; ++i)					\
      13        {								\
      14  	x[i] = -1;						\
      15  	y[i] = i * i;						\
      16  	z[i] = ((i + 2) % 3) * (i + 1);				\
      17  	pred[i] = i % 3;					\
      18        }								\
      19      test_##TYPE##_##NAME (x, y, z, pred, N);			\
      20      for (int i = 0; i < N; ++i)					\
      21        {								\
      22  	TYPE expected = i % 3 != 1 ? y[i] OP z[i] : 1;		\
      23  	if (x[i] != expected)					\
      24  	  __builtin_abort ();					\
      25  	asm volatile ("" ::: "memory");				\
      26        }								\
      27    }
      28  
      29  int
      30  main (void)
      31  {
      32    TEST_ALL
      33    return 0;
      34  }