OSDN Git Service

patch for PR rtl-optimization/25130
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20020415-1.c
1 /* PR target/6303
2    This testcase ICEd because s390 did not define
3    ASM_SIMPLIFY_DWARF_ADDR hook.  */
4 /* { dg-do compile { target fpic } } */
5 /* { dg-options "-O2 -fpic -g" } */
6
7 static inline char *
8 bar (unsigned long x, char *y)
9 {
10   extern const char ext[];
11   const char *a = ext;
12   char *b = y;
13
14   do *--b = a[x % 10]; while ((x /= 10) != 0);
15   return b;
16 }
17
18 struct A { char *p, *q; };
19 struct B { int r, s; };
20
21 int
22 foo (struct A *a, const struct B *b)
23 {
24   char c[(b->r > b->s) ? b->r : b->s];
25   char *d = &c[sizeof c];
26   register char *e;
27
28   e = bar (b->r, d);
29   while (e < d)
30     {
31       register const int f = *e++;
32       if (((a->p >= a->q) ? 1 : (unsigned char) (*a->p++ = f)) == -1)
33         break;
34     }
35 }