Merged with mainline at revision 128810.
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-36.c
blob98d1473419e9b1bb62c4c14129e3749e50c7a72a
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_shift } */
4 #define N 32
6 /* All the loops are vectorizable on platforms with vector shift argument. */
8 void
9 test_1 (void)
11 static unsigned int bm[N];
12 static unsigned int cm[N];
13 int j;
15 /* Vectorizable on platforms with scalar shift argument. */
16 for (j = 0; j < N/2; j++)
18 bm[2*j] <<= 8;
19 bm[2*j+1] <<= 8;
22 /* Not vectorizable on platforms with scalar shift argument. */
23 for (j = 0; j < N/2; j++)
25 cm[2*j] <<= 8;
26 cm[2*j+1] <<= 7;
30 void
31 test_2 (int a, int b)
33 static unsigned int bm[N];
34 static unsigned int cm[N];
35 int j;
37 /* Vectorizable on platforms with scalar shift argument. */
38 for (j = 0; j < N/2; j++)
40 bm[2*j] <<= a;
41 bm[2*j+1] <<= a;
44 /* Not vectorizable on platforms with scalar shift argument. */
45 for (j = 0; j < N/2; j++)
47 cm[2*j] <<= a;
48 cm[2*j+1] <<= b;
52 void
53 test_3 (void)
55 static unsigned int bm[N];
56 int am[N];
57 int j;
59 /* Not vectorizable on platforms with scalar shift argument. */
60 for (j = 0; j < N/2; j++)
62 bm[2*j] <<= am[j];
63 bm[2*j+1] <<= am[j];
66 /* Not vectorizable on platforms with scalar shift argument. */
67 for (j = 0; j < N/2; j++)
69 bm[2*j] <<= am[2*j];
70 bm[2*j+1] <<= am[2*j+1];
75 /* { dg-final { cleanup-tree-dump "vect" } } */