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

powered by: WebSVN 2.1.0

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