FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / gcc.dg / 20020415-1.c
blobde7fc614f48998fcf3687493016c639a0e582d1b
1 /* PR target/6303
2 This testcase ICEd because s390 did not define
3 ASM_SIMPLIFY_DWARF_ADDR hook. */
4 /* { dg-do compile } */
5 /* { dg-options "-O2 -fpic -g" } */
6 /* { dg-warning "not supported" "PIC unsupported" { target cris-*-elf* mmix-*-* } 0 } */
8 static inline char *
9 bar (unsigned long x, char *y)
11 extern const char ext[];
12 const char *a = ext;
13 char *b = y;
15 do *--b = a[x % 10]; while ((x /= 10) != 0);
16 return b;
19 struct A { char *p, *q; };
20 struct B { int r, s; };
22 int
23 foo (struct A *a, const struct B *b)
25 char c[(b->r > b->s) ? b->r : b->s];
26 char *d = &c[sizeof c];
27 register char *e;
29 e = bar (b->r, d);
30 while (e < d)
32 register const int f = *e++;
33 if (((a->p >= a->q) ? 1 : (unsigned char) (*a->p++ = f)) == -1)
34 break;