]> gcc.gnu.org Git - gcc.git/commitdiff
* gcc.c-torture/execute/980707-1.c: New test.
authorJeffrey A Law <law@cygnus.com>
Tue, 7 Jul 1998 10:50:43 +0000 (10:50 +0000)
committerJeff Law <law@gcc.gnu.org>
Tue, 7 Jul 1998 10:50:43 +0000 (04:50 -0600)
From-SVN: r20993

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/980707-1.c [new file with mode: 0644]

index 5bba10a202aace6c6ec010d7978b0cf3a7215538..06fd53d8d22a1f96d202c9b85b2752f68599713b 100644 (file)
@@ -1,3 +1,7 @@
+Tue Jul  7 11:49:04 1998  Jeffrey A Law  (law@cygnus.com)
+
+       * gcc.c-torture/execute/980707-1.c: New test.
+
 Mon Jul  6 18:20:27 1998  Kamil Iskra  <iskra@student.uci.agh.edu.pl>
 
        * gcc.c-torture/compile/980706-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/execute/980707-1.c b/gcc/testsuite/gcc.c-torture/execute/980707-1.c
new file mode 100644 (file)
index 0000000..3af163a
--- /dev/null
@@ -0,0 +1,46 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+
+char **
+buildargv (char *input)
+{
+  static char *arglist[256];
+  int numargs = 0;
+
+  while (1)
+    {
+      while (isspace ((unsigned char)*input) && *input != 0)
+       input++;
+      if (*input == 0)
+       break;
+      arglist [numargs++] = input;
+      while (!isspace ((unsigned char)*input) && *input != 0)
+       input++;
+      if (*input == 0)
+       break;
+      *(input++) = 0;
+    }
+  arglist [numargs] = NULL;
+  return arglist;
+}
+
+
+int main()
+{
+  char **args;
+  char input[256];
+  int i;
+
+  strcpy(input, " a b");
+  args = buildargv(input);
+
+  if (strcmp (args[0], "a"))
+    abort ();
+  if (strcmp (args[1], "b"))
+    abort ();
+  if (args[2] != NULL)
+    abort ();
+  
+  exit (0);
+}
This page took 0.111503 seconds and 5 git commands to generate.