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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [pr26840.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern int f1 (void **);
2
extern void f2 (void *);
3
 
4
struct s
5
{
6
  unsigned char field1;
7
  int field2;
8
};
9
 
10
static inline struct s *
11
get_globals (void)
12
{
13
  struct s * r;
14
  void * rr;
15
 
16
  if (f1 (&rr))
17
    return 0;
18
  r = rr;
19
  if (! r)
20
    {
21
      extern struct s t;
22
      r = &t;
23
    }
24
  r->field1 = 1;
25
  return r;
26
}
27
 
28
void
29
atexit_common (const void *dso)
30
{
31
  struct s *g = get_globals ();
32
 
33
  if (! g)
34
    return;
35
  if (g->field1)
36
    {
37
      g->field2 = 0;
38
      f2 (g);
39
    }
40
  else
41
    f2 (g);
42
}

powered by: WebSVN 2.1.0

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