LWG 3035. std::allocator's constructors should be constexpr
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-34-big-array.c
blob9e9c8207f7bbb0235e5864b529869b6db3768087
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 64
8 unsigned short in[N*8];
9 unsigned short in2[N*8];
11 int
12 main1 ()
14 int i;
15 unsigned short out[N*8];
16 unsigned short out2[N*8];
18 for (i = 0; i < N*8; i++)
20 in[i] = in2[i] = i;
21 asm volatile ("" ::: "memory");
24 /* SLP with unrolling by 8. */
25 for (i = 0; i < N; i++)
27 out[i*3] = in[i*3] + 5;
28 out[i*3 + 1] = in[i*3 + 1] + 6;
29 out[i*3 + 2] = in[i*3 + 2] + 16;
31 out2[i*5] = in2[i*5] + 2;
32 out2[i*5 + 1] = in2[i*5 + 1] + 2;
33 out2[i*5 + 2] = in2[i*5 + 2] + 1;
34 out2[i*5 + 3] = in2[i*5 + 3] + 3;
35 out2[i*5 + 4] = in2[i*5 + 4] + 13;
38 /* check results: */
39 for (i = 0; i < N; i++)
41 if (out[i*3] != in[i*3] + 5
42 || out[i*3 + 1] != in[i*3 + 1] + 6
43 || out[i*3 + 2] != in[i*3 + 2] + 16
44 || out2[i*5] != in2[i*5] + 2
45 || out2[i*5 + 1] != in2[i*5 + 1] + 2
46 || out2[i*5 + 2] != in2[i*5 + 2] + 1
47 || out2[i*5 + 3] != in2[i*5 + 3] + 3
48 || out2[i*5 + 4] != in2[i*5 + 4] + 13)
49 abort ();
52 return 0;
55 int main (void)
57 check_vect ();
59 main1 ();
61 return 0;
64 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
65 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */