PR tree-optimization/84740
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / pr56826.c
blobe8223808184e6b7b37a6d458bdb440566314e959
1 #include "tree-vect.h"
3 extern void abort (void);
5 typedef struct {
6 int a[3];
7 int num;
8 } t1;
9 t1 B[100];
10 int A[300];
12 void __attribute__((noinline,noclone))
13 bar (int *A, t1 *B, int n)
15 int i;
16 int *a = A;
17 for (i=0; i<n; i++, a+=3)
19 a[0] = B[i].a[0];
20 a[1] = B[i].a[1];
21 a[2] = B[i].a[2];
25 int main()
27 int i;
28 check_vect ();
29 for (i=0; i<100; i++)
31 B[i].num = i;
32 B[i].a[0] = i * 3;
33 B[i].a[1] = i * 3 + 1;
34 B[i].a[2] = i * 3 + 2;
35 __asm__ volatile ("");
37 bar (&A[0], &B[0], 100);
38 for (i=0; i<300; i++)
39 if (A[i] != i)
40 abort ();
41 return 0;