libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-multitypes-11.c
blob0f7b479ce594bf5c045062cf0a6e8d14cfb61066
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 18
8 struct s
10 int a;
11 int b;
12 int c;
15 char in[N*3] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53};
17 __attribute__ ((noinline)) int
18 main1 ()
20 int i;
21 struct s out[N];
23 for (i = 0; i < N; i++)
25 out[i].a = (int) in[i*3] + 1;
26 out[i].b = (int) in[i*3 + 1] + 2;
27 out[i].c = (int) in[i*3 + 2] + 3;
30 /* check results: */
31 #pragma GCC novector
32 for (i = 0; i < N; i++)
34 if (out[i].a != (int) in[i*3] + 1
35 || out[i].b != (int) in[i*3 + 1] + 2
36 || out[i].c != (int) in[i*3 + 2] + 3)
37 abort ();
40 return 0;
43 int main (void)
45 check_vect ();
47 main1 ();
49 return 0;
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_unpack } } } */
53 /* The epilogues are vectorized using partial vectors. */
54 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_unpack && { { ! vect_partial_vectors_usage_1 } || s390_vx } } } } } */
55 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { { vect_unpack && vect_partial_vectors_usage_1 } && { ! s390_vx } } } } } */