gcc/
[official-gcc.git] / gcc / testsuite / gcc.dg / pr47383.c
blob3e2b9ba18a2fd44849bc49dd356efe07100b8f37
1 /* { dg-do run { target fpic } } */
2 /* { dg-options "-O2 -fPIC" } */
4 static int heap[2*(256 +1+29)+1];
5 static int heap_len;
6 static int heap_max;
7 void
8 __attribute__ ((noinline))
9 foo (int elems)
11 int n, m;
12 int max_code = -1;
13 int node = elems;
14 heap_len = 0, heap_max = (2*(256 +1+29)+1);
15 for (n = 0; n < elems; n++)
16 heap[++heap_len] = max_code = n;
17 do {
18 n = heap[1];
19 heap[1] = heap[heap_len--];
20 m = heap[1];
21 heap[--heap_max] = n;
22 heap[--heap_max] = m;
23 } while (heap_len >= 2);
26 int
27 main ()
29 foo (286);
30 return 0;