Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-28.c
blobe698eef93a499136550c8ff798275bf3b3f5aabc
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 128
7 #define OFF 3
9 /* unaligned store. */
11 __attribute__ ((noinline))
12 int main1 (int off)
14 int i;
15 int ia[N+OFF];
17 for (i = 0; i < N; i++)
19 ia[i+off] = 5;
22 /* check results: */
23 for (i = 0; i < N; i++)
25 if (ia[i+off] != 5)
26 abort ();
29 return 0;
32 int main (void)
34 check_vect ();
36 main1 (0); /* aligned */
37 main1 (OFF); /* unaligned */
38 return 0;
41 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
42 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */
43 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { target vector_alignment_reachable } } } */
44 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" { target { ! vector_alignment_reachable } } } } */
45 /* { dg-final { cleanup-tree-dump "vect" } } */