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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [setjmp-4.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O" } */
3
 
4
#include <setjmp.h>
5
 
6
extern void abort (void);
7
 
8
jmp_buf buf;
9
 
10
void raise0(void)
11
{
12
  __builtin_longjmp (buf, 1);
13
}
14
 
15
int execute(int cmd)
16
{
17
  int last = 0;
18
 
19
  __builtin_setjmp (buf);
20
 
21
  if (last == 0)
22
    while (1)
23
      {
24
        last = 1;
25
        raise0 ();
26
      }
27
 
28
  if (last == 0)
29
    return 0;
30
  else
31
    return cmd;
32
}
33
 
34
int main(void)
35
{
36
  if (execute (1) == 0)
37
    abort ();
38
 
39
  return 0;
40
}

powered by: WebSVN 2.1.0

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