]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/vect/vect-29a.c
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / vect / vect-29a.c
1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
3 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
4 /* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -mmmx" { target i?86-*-* x86_64-*-* } } */
5
6 #include <stdarg.h>
7 #include "tree-vect.h"
8
9 #define N 128
10 #define OFF 3
11
12 /* unaligned load. */
13
14 int main1 (int off)
15 {
16 int i;
17 int ia[N];
18 int ib[N+OFF];
19
20 for (i = 0; i < N+OFF; i++)
21 {
22 ib[i] = i;
23 }
24
25 for (i = 0; i < N; i++)
26 {
27 ia[i] = ib[i+off];
28 }
29
30 /* check results: */
31 for (i = 0; i < N; i++)
32 {
33 if (ia[i] != ib[i+off])
34 abort ();
35 }
36
37 return 0;
38 }
39
40 int main (void)
41 {
42 check_vect ();
43
44 main1 (0); /* aligned */
45 main1 (OFF); /* unaligned */
46 return 0;
47 }
48
49 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
50