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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [non-local-goto-2.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
 
4
extern void abort (void);
5
 
6
int global;
7
 
8
static foo(void) __attribute__((noinline));
9
 
10
static foo(void)
11
{
12
  global = 1;
13
}
14
 
15
static bar(void)
16
{
17
  foo ();
18
  global = 0;
19
}
20
 
21
int execute(int cmd)
22
{
23
  __label__ start;
24
 
25
  void raise(void)
26
  {
27
    goto start;
28
  }
29
 
30
  int last;
31
 
32
  bar ();
33
 
34
  last = 0;
35
 
36
start:
37
 
38
  if (last == 0)
39
    while (1)
40
      {
41
        last = 1;
42
        raise ();
43
      }
44
 
45
  if (last == 0)
46
    return 0;
47
  else
48
    return cmd;
49
}
50
 
51
int main(void)
52
{
53
  if (execute (1) == 0)
54
    abort ();
55
 
56
  return 0;
57
}

powered by: WebSVN 2.1.0

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