Add new test to verify that the array index, limit, and stride are
[official-gcc.git] / gcc / testsuite / gcc.dg / 20020415-1.c
blob7d5b5aebdea1a81c353ec6277a6e1790ff6b12fd
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" } */
7 static inline char *
8 bar (unsigned long x, char *y)
10 extern const char ext[];
11 const char *a = ext;
12 char *b = y;
14 do *--b = a[x % 10]; while ((x /= 10) != 0);
15 return b;
18 struct A { char *p, *q; };
19 struct B { int r, s; };
21 int
22 foo (struct A *a, const struct B *b)
24 char c[(b->r > b->s) ? b->r : b->s];
25 char *d = &c[sizeof c];
26 register char *e;
28 e = bar (b->r, d);
29 while (e < d)
31 register const int f = *e++;
32 if (((a->p >= a->q) ? 1 : (unsigned char) (*a->p++ = f)) == -1)
33 break;