1/* { dg-require-effective-target vect_shift_char } */ 2/* { dg-require-effective-target vect_int } */ 3 4#include "tree-vect.h" 5 6#define N 32 7 8unsigned char dst[N] __attribute__((aligned(N))); 9unsigned char src[N] __attribute__((aligned(N))); 10 11__attribute__ ((noinline)) 12void array_shift(void) 13{ 14 int i; 15 for (i = 0; i < N; i++) 16 dst[i] = src[i] >> 3; 17} 18 19int main() 20{ 21 volatile int i; 22 check_vect (); 23 24 for (i = 0; i < N; i++) 25 src[i] = i << 3; 26 27 array_shift (); 28 29 for (i = 0; i < N; i++) 30 if (dst[i] != i) 31 abort (); 32 33 return 0; 34} 35 36/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ 37/* { dg-final { cleanup-tree-dump "vect" } } */ 38