Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2002-06-18 20:07:14 +0400
committerJeff Johnston <jjohnstn@redhat.com>2002-06-18 20:07:14 +0400
commit4e04fa902a3117ff9f2f81237a19e892314e924f (patch)
tree8cec0239b91ac320056a16584555a32af25a9344 /newlib/testsuite
parent8cb1442e10e5d4126a78b564839b160045001698 (diff)
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.
Diffstat (limited to 'newlib/testsuite')
-rw-r--r--newlib/testsuite/newlib.stdlib/atexit.c48
-rw-r--r--newlib/testsuite/newlib.stdlib/atexit.exp13
-rw-r--r--newlib/testsuite/newlib.string/tstring.c2
3 files changed, 62 insertions, 1 deletions
diff --git a/newlib/testsuite/newlib.stdlib/atexit.c b/newlib/testsuite/newlib.stdlib/atexit.c
new file mode 100644
index 000000000..48fdb6733
--- /dev/null
+++ b/newlib/testsuite/newlib.stdlib/atexit.c
@@ -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
index 000000000..777110d30
--- /dev/null
+++ b/newlib/testsuite/newlib.stdlib/atexit.exp
@@ -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"
diff --git a/newlib/testsuite/newlib.string/tstring.c b/newlib/testsuite/newlib.string/tstring.c
index f7dd2d6e7..e4339232b 100644
--- a/newlib/testsuite/newlib.string/tstring.c
+++ b/newlib/testsuite/newlib.string/tstring.c
@@ -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)