Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / slp-36.c
blob8480c4a05f1b3e6d2f3765c421035ea4c4cd5327
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3 /* { dg-require-effective-target vect_shift } */
5 #define N 32
7 /* All the loops are vectorizable on platforms with vector shift argument. */
9 void
10 test_1 (void)
12 static unsigned int bm[N];
13 static unsigned int cm[N];
14 int j;
16 /* Vectorizable on platforms with scalar shift argument. */
17 for (j = 0; j < N/2; j++)
19 bm[2*j] <<= 8;
20 bm[2*j+1] <<= 8;
23 /* Not vectorizable on platforms with scalar shift argument. */
24 for (j = 0; j < N/2; j++)
26 cm[2*j] <<= 8;
27 cm[2*j+1] <<= 7;
31 void
32 test_2 (int a, int b)
34 static unsigned int bm[N];
35 static unsigned int cm[N];
36 int j;
38 /* Vectorizable on platforms with scalar shift argument. */
39 for (j = 0; j < N/2; j++)
41 bm[2*j] <<= a;
42 bm[2*j+1] <<= a;
45 /* Not vectorizable on platforms with scalar shift argument. */
46 for (j = 0; j < N/2; j++)
48 cm[2*j] <<= a;
49 cm[2*j+1] <<= b;
53 void
54 test_3 (void)
56 static unsigned int bm[N];
57 int am[N];
58 int j;
60 /* Not vectorizable on platforms with scalar shift argument. */
61 for (j = 0; j < N/2; j++)
63 bm[2*j] <<= am[j];
64 bm[2*j+1] <<= am[j];
67 /* Not vectorizable on platforms with scalar shift argument. */
68 for (j = 0; j < N/2; j++)
70 bm[2*j] <<= am[2*j];
71 bm[2*j+1] <<= am[2*j+1];
76 /* { dg-final { cleanup-tree-dump "vect" } } */