source: trunk/libs/newlib/src/newlib/testsuite/newlib.stdlib/atexit.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 541 bytes
Line 
1#include <stdlib.h>
2#include <stdio.h>
3
4void a(void);
5void b(void);
6void c(int, void *);
7static void newline(void);
8
9void a (void)
10{
11  printf("a");
12}
13
14void b (void)
15{
16  printf("b");
17}
18
19void c (int code, void *k)
20{
21  char *x = (char *)k;
22  printf("%d%c",code,x[0]);
23}
24
25static void newline (void)
26{
27  printf("\n");
28}
29
30int main()
31{
32  if (atexit(newline) != 0)
33    abort();
34
35  if (atexit(a) != 0)
36    abort();
37
38  if (atexit(b) != 0)
39    abort();
40
41  if (on_exit(c,(void *)"c") != 0)
42    abort();
43
44  if (atexit(a) != 0)
45    abort();
46
47  exit(0);
48}
Note: See TracBrowser for help on using the repository browser.