PR target/55146
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-multitypes-11-big-array.c
blobb7a7a0be11ba115faf4054f3f193cfdf431262e1
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 144
8 struct s
10 int a;
11 int b;
12 int c;
15 char in[N*3];
16 volatile int y = 0;
18 __attribute__ ((noinline)) int
19 main1 ()
21 int i;
22 struct s out[N];
24 for (i = 0; i < N; i++)
26 in[i] = i&127;
27 if (y) /* Avoid vectorization. */
28 abort ();
31 for (i = 0; i < N; i++)
33 out[i].a = (int) in[i*3] + 1;
34 out[i].b = (int) in[i*3 + 1] + 2;
35 out[i].c = (int) in[i*3 + 2] + 3;
38 /* check results: */
39 for (i = 0; i < N; i++)
41 if (out[i].a != (int) in[i*3] + 1
42 || out[i].b != (int) in[i*3 + 1] + 2
43 || out[i].c != (int) in[i*3 + 2] + 3)
44 abort ();
47 return 0;
50 int main (void)
52 check_vect ();
54 main1 ();
56 return 0;
59 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
60 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_unpack } } } */
61 /* { dg-final { cleanup-tree-dump "vect" } } */