OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [newlib/] [testsuite/] [newlib.stdlib/] [atexit.c] - Blame information for rev 158

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
#include <stdlib.h>
2
#include <stdio.h>
3
 
4
void a(void);
5
void b(void);
6
void c(int, void *);
7
static void newline(void);
8
 
9
void a (void)
10
{
11
  printf("a");
12
}
13
 
14
void b (void)
15
{
16
  printf("b");
17
}
18
 
19
void c (int code, void *k)
20
{
21
  char *x = (char *)k;
22
  printf("%d%c",code,x[0]);
23
}
24
 
25
static void newline (void)
26
{
27
  printf("\n");
28
}
29
 
30
int 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.