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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [newlib/] [testsuite/] [newlib.stdlib/] [atexit.c] - Rev 258

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

#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);
}
 

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

powered by: WebSVN 2.1.0

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