PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-35.c
blob76fe32d68ad466c4d1933b1efc01727683cde027
1 /* { dg-require-effective-target vect_int } */
3 #include <stdarg.h>
4 #include "tree-vect.h"
6 #define N 16
8 __attribute__ ((noinline))
9 int main1 ()
11 union {
12 unsigned char a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
13 unsigned char b[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
14 } s;
15 int i;
17 /* Initialization. */
18 for (i = 0; i < N; i++)
20 s.b[i] = i;
23 /* Dependence analysis fails cause s.a and s.b may overlap.
24 Try to use runtime aliasing test with versioning, and
25 later versioning/vectorization are skipped because the
26 overlap is proven at compilation time. */
27 for (i = 0; i < N; i++)
29 s.a[i] = s.b[i] + 1;
32 /* check results: */
33 for (i = 0; i < N; i++)
35 if (s.a[i] != i + 1)
36 abort ();
39 return 0;
42 int main (void)
44 check_vect ();
46 return main1 ();
50 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail { ia64-*-* sparc*-*-* } } } } */
51 /* { dg-final { scan-tree-dump "can't determine dependence between" "vect" } } */