]> sourceware.org Git - newlib-cygwin.git/commitdiff
2002-06-18 Jeff Johnston <jjohnstn@redhat.com>
authorJeff Johnston <jjohnstn@redhat.com>
Tue, 18 Jun 2002 16:07:14 +0000 (16:07 +0000)
committerJeff Johnston <jjohnstn@redhat.com>
Tue, 18 Jun 2002 16:07:14 +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 cb7905914a54aa9260ed903b83f5e9f51c7daba4..154da62bfb76544db16c59f3c1d1a8ea2383bbe7 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 f7dd2d6e7251b99217c960271cc9e1479718ca45..e4339232b607809fbbc5ca9cb0d2da786cee45f7 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)
This page took 0.045174 seconds and 5 git commands to generate.