1  /* { dg-do compile } */
       2  /* { dg-require-effective-target arm_v8_1m_mve_ok } */
       3  /* { dg-add-options arm_v8_1m_mve } */
       4  /* { dg-additional-options "-O3" } */
       5  
       6  #include <stdint.h>
       7  
       8  #define FUNC(SIGN, TYPE, BITS, NB)					\
       9    TYPE##32_t test_ ##_ ## SIGN ## BITS ## x ## NB (TYPE##BITS##_t *a) { \
      10      int i;								\
      11      TYPE##BITS##_t result = 0;						\
      12      for (i=0; i<NB; i++) {						\
      13        result += a[i];							\
      14      }									\
      15      return result;							\
      16  }
      17  
      18  /* 128-bit vectors.  */
      19  FUNC(s, int, 8, 16)
      20  FUNC(u, uint, 8, 16)
      21  FUNC(s, int, 16, 8)
      22  FUNC(u, uint, 16, 8)
      23  FUNC(s, int, 32, 4)
      24  FUNC(u, uint, 32, 4)
      25  
      26  /* { dg-final { scan-assembler-times {vaddv\.s} 6 } } */