OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.target/] [s390/] [return-addr1.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 324 jeremybenn
/* builtin_return_address(n) with n>0 has always been troublesome ...
2
   especially when the S/390 packed stack layout comes into play.  */
3
 
4
/* { dg-do run } */
5
/* { dg-options "-O3 -fno-optimize-sibling-calls -mbackchain -mpacked-stack -msoft-float" } */
6
 
7
void *addr1;
8
 
9
extern void abort (void);
10
 
11
void * __attribute__((noinline))
12
foo1 ()
13
{
14
  addr1 = __builtin_return_address (2);
15
}
16
 
17
void * __attribute__((noinline))
18
foo2 ()
19
{
20
  foo1 ();
21
}
22
 
23
void * __attribute__((noinline))
24
foo3 ()
25
{
26
  foo2 ();
27
}
28
 
29
void __attribute__((noinline))
30
bar ()
31
{
32
  void *addr2;
33
 
34
  foo3 ();
35
  asm volatile ("basr  %0,0\n\t" : "=d" (addr2));
36
  /* basr is two bytes in length.  */
37
  if (addr2 - addr1 != 2)
38
    abort ();
39
}
40
 
41
int
42
main ()
43
{
44
  bar();
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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