libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-iv-8-big-array.c
blob26e8c499ce50cc91116c558a2425a47ebe21cdf7
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
8 __attribute__ ((noinline)) int main1 (short X)
10 unsigned char a[N];
11 unsigned short b[N];
12 unsigned int c[N];
13 short myX = X;
14 int i;
16 /* vectorization of induction with type conversions. */
17 for (i = 0; i < N; i++)
19 a[i] = (unsigned char)X;
20 b[i] = X;
21 c[i] = (unsigned int)X;
22 X++;
25 /* check results: */
26 #pragma GCC novector
27 for (i = 0; i < N; i++)
29 if (a[i] != (unsigned char)myX || b[i] != myX || c[i] != (unsigned int)myX++)
30 abort ();
33 return 0;
36 int main (void)
38 check_vect ();
40 return main1 (3);
43 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_pack_trunc && vect_unpack } } } } */