Merge from mainline (160224:163495).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / bb-slp-10.c
blob991802fb87c16fca32ba0c79594e2c03441743e9
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include <stdio.h>
5 #include "tree-vect.h"
7 #define N 16
9 unsigned int out[N];
10 unsigned int in[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
12 __attribute__ ((noinline)) int
13 main1 (unsigned int x, unsigned int y)
15 int i;
16 unsigned int *pin = &in[0];
17 unsigned int *pout = &out[1];
18 unsigned int a0, a1, a2, a3;
20 /* Misaligned store. */
21 a0 = *pin++ + 23;
22 a1 = *pin++ + 142;
23 a2 = *pin++ + 2;
24 a3 = *pin++ + 31;
26 *pout++ = a0 * x;
27 *pout++ = a1 * y;
28 *pout++ = a2 * x;
29 *pout++ = a3 * y;
31 if (x)
32 __asm__ volatile ("" : : : "memory");
34 /* Check results. */
35 if (out[1] != (in[0] + 23) * x
36 || out[2] != (in[1] + 142) * y
37 || out[3] != (in[2] + 2) * x
38 || out[4] != (in[3] + 31) * y)
39 abort();
41 return 0;
44 int main (void)
46 check_vect ();
48 main1 (2, 3);
50 return 0;
53 /* { dg-final { scan-tree-dump-times "unsupported alignment in basic block." 1 "slp" { xfail vect_hw_misalign } } } */
54 /* { dg-final { scan-tree-dump-times "basic block vectorized using SLP" 1 "slp" { target vect_hw_misalign } } } */
55 /* { dg-final { cleanup-tree-dump "slp" } } */