OSDN Git Service

2002-06-18 Jeff Johnston <jjohnstn@redhat.com>
authorjjohnstn <jjohnstn>
Tue, 18 Jun 2002 16:07:09 +0000 (16:07 +0000)
committerjjohnstn <jjohnstn>
Tue, 18 Jun 2002 16:07:09 +0000 (16:07 +0000)
        * testsuite/newlib.stdlib/atexit.c: New file.
        * testsuite/newlib.stdlib/atexit.exp: Ditto.
        * testsuite/newlib.string/tstring.c: Change default start size
        to something more reasonable for embedded platforms.

newlib/ChangeLog
newlib/testsuite/newlib.stdlib/atexit.c [new file with mode: 0644]
newlib/testsuite/newlib.stdlib/atexit.exp [new file with mode: 0644]
newlib/testsuite/newlib.string/tstring.c

index cb79059..154da62 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-18  Jeff Johnston  <jjohnstn@redhat.com>
+
+        * testsuite/newlib.stdlib/atexit.c: New file.
+        * testsuite/newlib.stdlib/atexit.exp: Ditto.
+        * testsuite/newlib.string/tstring.c: Change default start size
+        to something more reasonable for embedded platforms.
+
 2002-06-14  Thomas Fitzsimmons  <fitzsim@redhat.com>
 
        * libc/sys/linux/sys/errno.h (EFTYPE): Add macro.
diff --git a/newlib/testsuite/newlib.stdlib/atexit.c b/newlib/testsuite/newlib.stdlib/atexit.c
new file mode 100644 (file)
index 0000000..48fdb67
--- /dev/null
@@ -0,0 +1,48 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+void a(void);
+void b(void);
+void c(int, void *);
+static void newline(void);
+
+void a (void)
+{
+  printf("a");
+}
+
+void b (void)
+{
+  printf("b");
+}
+
+void c (int code, void *k)
+{
+  char *x = (char *)k;
+  printf("%d%c",code,x[0]);
+}
+
+static void newline (void)
+{
+  printf("\n");
+}
+
+int main()
+{
+  if (atexit(newline) != 0)
+    abort();
+
+  if (atexit(a) != 0)
+    abort();
+
+  if (atexit(b) != 0)
+    abort();
+
+  if (on_exit(c,(void *)"c") != 0)
+    abort();
+
+  if (atexit(a) != 0)
+    abort();
+
+  exit(0);
+}
diff --git a/newlib/testsuite/newlib.stdlib/atexit.exp b/newlib/testsuite/newlib.stdlib/atexit.exp
new file mode 100644 (file)
index 0000000..777110d
--- /dev/null
@@ -0,0 +1,13 @@
+# Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
+#
+# Permission to use, copy, modify, and distribute this software
+# is freely granted, provided that this notice is preserved.
+#
+
+load_lib checkoutput.exp
+
+set output {
+"a0cba"
+}
+
+newlib_check_output "atexit.c" "$output"
index f7dd2d6..e433923 100644 (file)
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 
 #ifndef MAX_1
-#define MAX_1 66000
+#define MAX_1 33000
 #endif
 
 #define MAX_2 (2 * MAX_1 + MAX_1 / 10)