LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-over-widen-3-big-array.c
blobe419f203ecadc29f43a9a10aa2c3378522dec227
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 VECTOR_BITS
9 /* Modified rgb to rgb conversion from FFmpeg. */
10 __attribute__ ((noinline)) void
11 foo (unsigned char *src, unsigned char *dst)
13 unsigned char *s = src;
14 unsigned short *d = (unsigned short *)dst;
15 int i;
17 for (i = 0; i < N/4; i++)
19 const int b = *s++;
20 const int g = *s++;
21 const int r = *s++;
22 const int a = *s++;
23 *d = ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9));
24 d++;
27 s = src;
28 d = (unsigned short *)dst;
29 for (i = 0; i < N/4; i++)
31 const int b = *s++;
32 const int g = *s++;
33 const int r = *s++;
34 const int a = *s++;
35 unsigned short expected
36 = ((b>>3) | ((g&0xFFC)<<3) | ((r+0xF8)>>8) | (a<<9));
37 if (*d != expected)
38 abort ();
39 d++;
43 int main (void)
45 int i;
46 unsigned char in[N], out[N];
48 check_vect ();
50 for (i = 0; i < N; i++)
52 in[i] = i;
53 out[i] = 255;
54 __asm__ volatile ("");
57 foo (in, out);
59 return 0;
62 /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 2 "vect" { target { ! vect_widen_shift } } } } */
63 /* { dg-final { scan-tree-dump-times "vect_recog_over_widening_pattern: detected" 1 "vect" { target vect_widen_shift } } } */
64 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */