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/] [980707-1.c] - Blame information for rev 414

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
#include <stdlib.h>
2
#include <string.h>
3
 
4
char **
5
buildargv (char *input)
6
{
7
  static char *arglist[256];
8
  int numargs = 0;
9
 
10
  while (1)
11
    {
12
      while (*input == ' ')
13
        input++;
14
      if (*input == 0)
15
        break;
16
      arglist [numargs++] = input;
17
      while (*input != ' ' && *input != 0)
18
        input++;
19
      if (*input == 0)
20
        break;
21
      *(input++) = 0;
22
    }
23
  arglist [numargs] = NULL;
24
  return arglist;
25
}
26
 
27
 
28
int main()
29
{
30
  char **args;
31
  char input[256];
32
  int i;
33
 
34
  strcpy(input, " a b");
35
  args = buildargv(input);
36
 
37
  if (strcmp (args[0], "a"))
38
    abort ();
39
  if (strcmp (args[1], "b"))
40
    abort ();
41
  if (args[2] != NULL)
42
    abort ();
43
 
44
  exit (0);
45
}

powered by: WebSVN 2.1.0

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