PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-multitypes-5.c
blobad11d78a548735a67f76b3aa7f98731d88868b56
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 32
8 unsigned int ia[N];
9 unsigned int ic[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
10 unsigned int ib[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
11 unsigned short sa[N];
12 unsigned short sc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
13 unsigned short sb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
14 unsigned char ca[N];
15 unsigned char cc[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
16 unsigned char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
18 __attribute__ ((noinline))
19 int main1 ()
21 int i;
23 /* Multiple types with different sizes, used in independent
24 computations. Vectorizable. All accesses aligned. */
25 for (i = 0; i < N; i++)
27 ia[i] = ib[i] + ic[i];
28 sa[i] = sb[i] + sc[i];
29 ca[i] = cb[i] + cc[i];
32 /* check results: */
33 for (i = 0; i < N; i++)
35 if (ia[i] != ib[i] + ic[i]
36 || sa[i] != sb[i] + sc[i]
37 || ca[i] != cb[i] + cc[i])
38 abort ();
41 return 0;
44 int main (void)
46 check_vect ();
48 return main1 ();
51 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { sparc*-*-* && ilp32 } } } } */