OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [pragma-init-fini.c] - Rev 298

Compare with Previous | Blame | View Log

/* Tests for #pragma init and #pragma fini.  */
 
/* { dg-do run { target *-*-solaris2.* } } */
 
extern void abort ();
 
#pragma init		/* { dg-warning "malformed" } */
#pragma init ()		/* { dg-warning "malformed" } */
#pragma init init_func	/* { dg-warning "malformed" } */
 
#pragma fini		/* { dg-warning "malformed" } */
#pragma fini ()		/* { dg-warning "malformed" } */
#pragma fini fini_func	/* { dg-warning "malformed" } */
 
#pragma init (init_func, init_static_func)
 
int glob_1, glob_2;
 
void init_func (void)
{
  glob_1 = 1;
}
 
static void init_static_func (void)
{
  glob_2 = 2;
}
 
#pragma fini (fini_func, fini_static_func)
 
void fini_func (void)
{
 
}
 
static void fini_static_func (void)
{
 
}
 
int main()
{
  if (glob_1 != 1)
    abort ();
 
  if (glob_2 != 2)
    abort ();
 
  return 0;
}
 

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.