1  /* { dg-do run { target aarch64_sve_hw } } */
       2  /* { dg-options "-O2 -ftree-vectorize -fno-trapping-math -ffinite-math-only" } */
       3  
       4  #include "vcond_9.c"
       5  
       6  #define N 187
       7  
       8  #define TEST_LOOP(TYPE, CMPTYPE, OP)				\
       9    {								\
      10      TYPE dest[N], src1[N], src2[N];				\
      11      CMPTYPE cond[N];						\
      12      for (unsigned int i = 0; i < N; ++i)			\
      13        {								\
      14          src1[i] = i * 4 - i % 7;				\
      15          src2[i] = i * 3 + 1;					\
      16  	cond[i] = i % 5;					\
      17        }								\
      18      f_##OP##_##TYPE (dest, cond, 3, src1, src2, N);		\
      19      for (unsigned int i = 0; i < N; ++i)			\
      20        {								\
      21  	TYPE src1v = i * 4 - i % 7;				\
      22          TYPE src2v = i * 3 + 1;					\
      23  	TYPE if_true = OP (src1v, src2v);			\
      24  	if (dest[i] != (i % 5 < 3 ? if_true : src2v))		\
      25  	  __builtin_abort ();					\
      26        }								\
      27    }
      28  
      29  int __attribute__ ((optimize (1)))
      30  main (void)
      31  {
      32    FOR_EACH_LOOP (TEST_LOOP);
      33    return 0;
      34  }