1  /* { dg-do run } */
       2  /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-all -fno-vect-cost-model" } */
       3  /* Write a reduction loop to be reduced using whole vector right shift.  */
       4  
       5  #pragma GCC target "+nosve"
       6  
       7  extern void abort (void);
       8  
       9  unsigned char in[8] __attribute__((__aligned__(16)));
      10  
      11  int
      12  main (unsigned char argc, char **argv)
      13  {
      14    unsigned char i = 0;
      15    unsigned char sum = 1;
      16  
      17    for (i = 0; i < 8; i++)
      18      in[i] = (i + i + 1) & 0xfd;
      19  
      20    /* Prevent constant propagation of the entire loop below.  */
      21    asm volatile ("" : : : "memory");
      22  
      23    for (i = 0; i < 8; i++)
      24      sum |= in[i];
      25  
      26    if (sum != 13)
      27      {
      28        __builtin_printf ("Failed %d\n", sum);
      29        abort ();
      30      }
      31  
      32    return 0;
      33  }
      34  
      35  /* { dg-final { scan-tree-dump "Reduce using vector shifts" "vect" } } */