Add compile command to each testcase
[gcc-vect-testsuite.git] / vect-align-1.c
blob099b7fea443ac1dad70202e1d7ab261cd1212a84
1 /* { dg-require-effective-target vect_int } */
3 #include <stdlib.h>
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 /* Compile time known misalignment. Cannot use loop peeling to align
8 the store. */
10 #define N 16
12 struct foo {
13 char x;
14 int y[N];
15 } __attribute__((packed));
17 int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
19 __attribute__ ((noinline)) int
20 main1 (struct foo * __restrict__ p)
22 int i;
24 for (i = 0; i < N; i++)
26 p->y[i] = x[i];
29 /* check results: */
30 for (i = 0; i < N; i++)
32 if (p->y[i] != x[i])
33 abort ();
35 return 0;
39 int main (void)
41 int i;
42 struct foo *p = malloc (2*sizeof (struct foo));
43 check_vect ();
45 main1 (p);
46 return 0;
49 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target vect_hw_misalign } } } */
50 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { xfail vect_hw_misalign} } } */
51 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
52 /* { dg-final { cleanup-tree-dump "vect" } } */