2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-widen-shift-s8.c
blob46512f2c69ba50521d6c7519a1c3d073e90b7436
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_shift } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #define N 64
8 #define C 12
10 __attribute__ ((noinline)) void
11 foo (char *src, int *dst)
13 int i;
14 char b, *s = src;
15 int *d = dst;
17 for (i = 0; i < N; i++)
19 b = *s++;
20 *d = b << C;
21 d++;
24 s = src;
25 d = dst;
26 for (i = 0; i < N; i++)
28 b = *s++;
29 if (*d != b << C)
30 abort ();
31 d++;
35 int main (void)
37 int i;
38 char in[N];
39 int out[N];
41 check_vect ();
43 for (i = 0; i < N; i++)
45 in[i] = i;
46 out[i] = 255;
47 __asm__ volatile ("");
50 foo (in, out);
52 return 0;
55 /* { dg-final { scan-tree-dump-times "vect_recog_widen_shift_pattern: detected" 1 "vect" { target vect_widen_shift } } } */
56 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */