Imported Upstream version 4.7.3
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.dg / vect / pr33833.c
1 /* Testcase by Martin Michlmayr <tbm@cyrius.com> */
2 /* { dg-do compile } */
3
4 #define signed
5 typedef unsigned __PTRDIFF_TYPE__ uintptr_t;
6 #undef signed
7
8 struct list_head
9 {
10   struct list_head *prev;
11 };
12 struct prio_array
13 {
14   struct list_head queue[100];
15 };
16 struct rq
17 {
18   struct prio_array *active, arrays[2];
19 } per_cpu__runqueues;
20
21 void sched_init (uintptr_t __ptr)
22 {
23   int j, k;
24   struct prio_array *array;
25   struct rq *rq;
26   rq = (&(*( { (typeof (&per_cpu__runqueues)) (__ptr); } )));
27   for (j = 0; j < 2; j++)
28   {
29     array = rq->arrays + j;
30     for (k = 0; k < 100; k++)
31         (array->queue + k)->prev = array->queue;
32   }
33 }
34
35 /* { dg-final { cleanup-tree-dump "vect" } } */