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.target/] [s390/] [return-addr2.c] - Rev 324

Compare with Previous | Blame | View Log

/* builtin_return_address(n) with n>0 has always been troublesome.  */
 
/* { dg-do run } */
/* { dg-options "-O3 -fno-optimize-sibling-calls -mbackchain" } */
 
void *addr1;
 
extern void abort (void);
 
void * __attribute__((noinline))
foo1 ()
{
  addr1 = __builtin_return_address (2);
}
 
void * __attribute__((noinline))
foo2 ()
{
  foo1 ();
}
 
void * __attribute__((noinline))
foo3 ()
{
  foo2 ();
}
 
void __attribute__((noinline))
bar ()
{
  void *addr2;
 
  foo3 ();
  asm volatile ("basr  %0,0\n\t" : "=d" (addr2));
  /* basr is two bytes in length.  */
  if (addr2 - addr1 != 2)
    abort ();
}
 
int
main ()
{
  bar();
  return 0;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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