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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [call-1.c] - Rev 691

Compare with Previous | Blame | View Log

/* PR optimization/11304 */
/* Originator: <manuel.serrano@sophia.inria.fr> */
/* { dg-do run } */
/* { dg-options "-O -fomit-frame-pointer" } */
 
/* Verify that %eax is always restored after a call.  */
 
extern void abort(void);
 
volatile int r;
 
void set_eax(int val)
{
  __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val));
}
 
void foo(int val)
{
  r = val;
}
 
int bar(int x)
{
  if (x)
  {
    set_eax(0);
    return x;
  }
 
  foo(x);
}
 
int main(void)
{
  if (bar(1) != 1)
    abort();
 
  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.