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

Subversion Repositories openrisc

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

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

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

powered by: WebSVN 2.1.0

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