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.c-torture/] [execute/] [frame-address.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 297 jeremybenn
int check_fa_work (const char *, const char *) __attribute__((noinline));
2
int check_fa_mid (const char *) __attribute__((noinline));
3
int check_fa (char *) __attribute__((noinline));
4
int how_much (void) __attribute__((noinline));
5
 
6
int check_fa_work (const char *c, const char *f)
7
{
8
  const char d = 0;
9
 
10
  if (c >= &d)
11
    return c >= f && f >= &d;
12
  else
13
    return c <= f && f <= &d;
14
}
15
 
16
int check_fa_mid (const char *c)
17
{
18
  const char *f = __builtin_frame_address (0);
19
 
20
  /* Prevent a tail call to check_fa_work, eliding the current stack frame.  */
21
  return check_fa_work (c, f) != 0;
22
}
23
 
24
int check_fa (char *unused)
25
{
26
  const char c = 0;
27
 
28
  return check_fa_mid (&c);
29
}
30
 
31
int how_much (void)
32
{
33
        return 8;
34
}
35
 
36
int main (void)
37
{
38
  char *unused = __builtin_alloca (how_much ());
39
 
40
  if (!check_fa(unused))
41
    abort();
42
  return 0;
43
}

powered by: WebSVN 2.1.0

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