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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [built-in-setjmp.c] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
extern int strcmp(const char *, const char *);
2
extern char *strcpy(char *, const char *);
3
extern void abort(void);
4
extern void exit(int);
5
 
6
void *buf[20];
7
 
8
void __attribute__((noinline))
9
sub2 (void)
10
{
11
  __builtin_longjmp (buf, 1);
12
}
13
 
14
int
15
main ()
16
{
17
  char *p = (char *) __builtin_alloca (20);
18
 
19
  strcpy (p, "test");
20
 
21
  if (__builtin_setjmp (buf))
22
    {
23
      if (strcmp (p, "test") != 0)
24
        abort ();
25
 
26
      exit (0);
27
    }
28
 
29
  {
30
    int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
31
    int i;
32
 
33
    for (i = 0; i < p[2]; i++)
34
      q[i] = 0;
35
 
36
    while (1)
37
      sub2 ();
38
  }
39
}

powered by: WebSVN 2.1.0

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