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-3.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
  if (__builtin_setjmp (buf) == 0)
19
    while (1)
20
      {
21
        last = 1;
22
        raise0 ();
23
      }
24
 
25
  if (last == 0)
26
    return 0;
27
  else
28
    return cmd;
29
}
30
 
31
int main(void)
32
{
33
  if (execute (1) == 0)
34
    abort ();
35
 
36
  return 0;
37
}

powered by: WebSVN 2.1.0

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