OSDN Git Service

PR testsuite/52641
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / 20031231-1.c
1 extern int f1 (int, void *);
2 extern int *f2 (void) __attribute__ ((__const__));
3 extern int f3 (int, void *);
4
5 int
6 test (int x, char *y, int z)
7 {
8   int b = 0;
9
10   if (x < 1024)
11     {
12       y[0] = '\0';
13
14       do
15         {
16           switch (f1 (x, y + b))
17             {
18             case -1:
19               if (b == 0)
20                 return -1;
21               else
22                 return b;
23
24             default:
25               b++;
26             }
27         }
28       while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z);
29     }
30   else
31     {
32       do
33         {
34           switch (f3 (x, y + b))
35             {
36             case -1:
37               if ((*f2 ()) == 4)
38                 continue;
39               if (b == 0)
40                 return -1;
41               else
42                 return b;
43
44             default:
45               b++;
46             }
47         }
48       while (y[b - 1] != '\0' && y[b - 1] != '\n' && b < z);
49     }
50   return b;
51 }