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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-prof/] [pr34999.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Same test as built-in-setjmp.c.  Includes the case where
2
   the source block of a crossing fallthru edge ends with a call.  */
3
/* { dg-require-effective-target freorder } */
4
/* { dg-options "-O2 -freorder-blocks-and-partition" } */
5
 
6
extern int strcmp(const char *, const char *);
7
extern char *strcpy(char *, const char *);
8
extern void abort(void);
9
extern void exit(int);
10
 
11
void *buf[20];
12
 
13
void __attribute__((noinline))
14
sub2 (void)
15
{
16
  __builtin_longjmp (buf, 1);
17
}
18
 
19
int
20
main ()
21
{
22
  char *p = (char *) __builtin_alloca (20);
23
 
24
  strcpy (p, "test");
25
 
26
  if (__builtin_setjmp (buf))
27
    {
28
      if (strcmp (p, "test") != 0)
29
        abort ();
30
 
31
      exit (0);
32
    }
33
 
34
  {
35
    int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
36
    int i;
37
 
38
    for (i = 0; i < p[2]; i++)
39
      q[i] = 0;
40
 
41
    while (1)
42
      sub2 ();
43
  }
44
}
45
 

powered by: WebSVN 2.1.0

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