OSDN Git Service

8a8e30f52062a06ba0296a9ebfb6a25563aebfd9
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / pr21591.c
1 /* { dg-do compile } */
2
3 struct a
4 {
5   int length;
6   int a1[256];
7 };
8
9 struct a *malloc1(__SIZE_TYPE__) __attribute__((malloc));
10 void free(void*);
11
12 void f(void)
13 {
14    struct a *a = malloc1(sizeof(struct a));
15    struct a *b = malloc1(sizeof(struct a));
16    struct a *c = malloc1(sizeof(struct a));
17    int i;
18
19    for (i = 0; i < 256; i++) 
20    {
21       b->a1[i] = i;
22       c->a1[i] = i;
23    }
24    for (i = 0; i < 256; i++) 
25    {
26       a->a1[i] = b->a1[i] + c->a1[i];
27    }
28    free(a);
29    free(b);
30    free(c);
31 }
32
33 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
34 /* { dg-final { cleanup-tree-dump "vect" } } */
35