OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20010915-1.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* Bug in reorg.c, deleting the "++" in the last loop in main.
2
   Origin: <hp@axis.com>.  */
3
 
4
extern void f (void);
5
extern int x (int, char **);
6
extern int r (const char *);
7
extern char *s (char *, char **);
8
extern char *m (char *);
9
char *u;
10
char *h;
11
int check = 0;
12
int o = 0;
13
 
14
int main (int argc, char **argv)
15
{
16
  char *args[] = {"a", "b", "c", "d", "e"};
17
  if (x (5, args) != 0 || check != 2 || o != 5)
18
    abort ();
19
  exit (0);
20
}
21
 
22
int x (int argc, char **argv)
23
{
24
  int opt = 0;
25
  char *g = 0;
26
  char *p = 0;
27
 
28
  if (argc > o && argc > 2 && argv[o])
29
    {
30
      g = s (argv[o], &p);
31
      if (g)
32
        {
33
          *g++ = '\0';
34
          h = s (g, &p);
35
          if (g == p)
36
            h = m (g);
37
        }
38
      u = s (argv[o], &p);
39
      if (argv[o] == p)
40
        u = m (argv[o]);
41
    }
42
  else
43
    abort ();
44
 
45
  while (++o < argc)
46
    if (r (argv[o]) == 0)
47
      return 1;
48
 
49
  return 0;
50
}
51
 
52
char *m (char *x) { abort (); }
53
char *s (char *v, char **pp)
54
{
55
  if (strcmp (v, "a") != 0 || check++ > 1)
56
    abort ();
57
  *pp = v+1;
58
  return 0;
59
}
60
 
61
int r (const char *f)
62
{
63
  static char c[2] = "b";
64
  static int cnt = 0;
65
 
66
  if (*f != *c || f[1] != c[1] || cnt > 3)
67
    abort ();
68
  c[0]++;
69
  cnt++;
70
  return 1;
71
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.