Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / gcc.dg / 20000807-1.c
blob360e3245989e9abcefde7cc5683b98811228e31a
1 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-Os -fpic" } */
4 #include <string.h>
6 typedef struct
8 char *a;
9 char *b;
10 } *foo;
12 void
13 bar (foo x)
15 char *c = x->b;
16 char *d = (void *)0;
17 unsigned int e = 0, f = 0, g;
18 while (*c != ':')
19 if (*c == '%')
21 ++c;
22 switch (*c++)
24 case 'N':
25 g = strlen (x->a);
26 if (e + g >= f) {
27 char *h = d;
28 f += 256 + g;
29 d = (char *) __builtin_alloca (f);
30 memcpy (d, h, e);
32 memcpy (&d[e], x->a, g);
33 e += g;
34 break;