2018-01-16 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-96.c
blob0cb935b9f162233a3c3e35b5fbc9e22f177a81f2
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-add-options double_vectors } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 #if VECTOR_BITS > 256
8 #define N (VECTOR_BITS * 2 / 32)
9 #else
10 #define N 16
11 #endif
13 struct tmp
15 int x;
16 int ia[N];
19 __attribute__ ((noinline))
20 int main1 (int off)
22 struct tmp sb[N];
23 struct tmp *pp = &sb[off];
24 int i, ib[N];
26 for (i = 0; i < N; i++)
27 pp->ia[i] = ib[i];
29 /* check results: */
30 for (i = 0; i < N; i++)
32 if (pp->ia[i] != ib[i])
33 abort();
36 return 0;
39 int main (void)
41 check_vect ();
43 return main1 (8);
46 /* The store is unaligned, the load is aligned. For targets that support unaligned
47 loads, peel to align the store and generate an unaligned access for the load.
48 For targets that don't support unaligned loads, version for the store. */
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
51 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && { ! vect_align_stack_vars } } xfail { ! vect_unaligned_possible } } } } */
52 /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { target { { {! vect_no_align} && vector_alignment_reachable } && vect_align_stack_vars } xfail { ! vect_unaligned_possible } } } } */
53 /* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail { { vect_no_align } || { { ! vector_alignment_reachable} || vect_element_align } } } } } */
54 /* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning." 1 "vect" { target { { vect_no_align && { ! vect_hw_misalign } } || { {! vector_alignment_reachable} && {! vect_element_align} } } } } } */