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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [pragma-init-fini.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* Tests for #pragma init and #pragma fini.  */
2
 
3
/* { dg-do run { target *-*-solaris2.* } } */
4
/* { dg-skip-if "no .pushsection/.popsection" { i?86-*-solaris2.8 && { ! gas } } } */
5
 
6
extern void abort ();
7
 
8
#pragma init            /* { dg-warning "malformed" } */
9
#pragma init ()         /* { dg-warning "malformed" } */
10
#pragma init init_func  /* { dg-warning "malformed" } */
11
 
12
#pragma fini            /* { dg-warning "malformed" } */
13
#pragma fini ()         /* { dg-warning "malformed" } */
14
#pragma fini fini_func  /* { dg-warning "malformed" } */
15
 
16
#pragma init (init_func, init_static_func)
17
 
18
int glob_1, glob_2;
19
 
20
void init_func (void)
21
{
22
  glob_1 = 1;
23
}
24
 
25
static void init_static_func (void)
26
{
27
  glob_2 = 2;
28
}
29
 
30
#pragma fini (fini_func, fini_static_func)
31
 
32
void fini_func (void)
33
{
34
 
35
}
36
 
37
static void fini_static_func (void)
38
{
39
 
40
}
41
 
42
int main()
43
{
44
  if (glob_1 != 1)
45
    abort ();
46
 
47
  if (glob_2 != 2)
48
    abort ();
49
 
50
  return 0;
51
}

powered by: WebSVN 2.1.0

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