2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-strided-shift-1.c
blobb1ce2ece1707ef23d4aa81b715f8ac7dfcbeafe6
1 /* PR tree-optimization/65963. */
2 #include "tree-vect.h"
4 #define N 512
6 int in[2*N], out[N];
8 __attribute__ ((noinline)) void
9 loop (void)
11 for (int i = 0; i < N; i++)
12 out[i] = in[i << 1] + 7;
15 int
16 main (int argc, char **argv)
18 check_vect ();
19 for (int i = 0; i < 2*N; i++)
21 in[i] = i;
22 __asm__ volatile ("" : : : "memory");
24 loop ();
25 __asm__ volatile ("" : : : "memory");
26 for (int i = 0; i < N; i++)
28 if (out[i] != i*2 + 7)
29 abort ();
31 return 0;
33 /* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 1 "vect" { target { vect_strided2 } } } } */