Merge from mainline (163495:164578).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gcc.dg / vect / vect-peel-3.c
blob06d49077f2d5b45c71b5baa4e04e05bc2957fda7
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include <stdio.h>
5 #include "tree-vect.h"
7 #define N 128
8 #define RES 21888
10 /* unaligned store. */
12 int ib[N+10];
13 int ia[N+10];
14 int ic[N+10];
16 __attribute__ ((noinline))
17 int main1 ()
19 int i, suma = 0, sumb = 0, sumc = 0;
21 /* ib and ic have same misalignment, we peel to align them. */
22 for (i = 1; i <= N; i++)
24 suma += ia[i];
25 sumb += ib[i+6];
26 sumc += ic[i+2];
29 /* check results: */
30 if (suma + sumb + sumc != RES)
31 abort ();
33 return 0;
36 int main (void)
38 int i;
40 check_vect ();
42 for (i = 0; i < N+10; i++)
44 ib[i] = i;
45 ic[i] = i+2;
46 ia[i] = i/2;
49 return main1 ();
52 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
54 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" } } */
55 /* { dg-final { cleanup-tree-dump "vect" } } */