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/] [i386/] [call-1.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* PR optimization/11304 */
2
/* Originator: <manuel.serrano@sophia.inria.fr> */
3
/* { dg-do run } */
4
/* { dg-options "-O -fomit-frame-pointer" } */
5
 
6
/* Verify that %eax is always restored after a call.  */
7
 
8
extern void abort(void);
9
 
10
volatile int r;
11
 
12
void set_eax(int val)
13
{
14
  __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val));
15
}
16
 
17
void foo(int val)
18
{
19
  r = val;
20
}
21
 
22
int bar(int x)
23
{
24
  if (x)
25
  {
26
    set_eax(0);
27
    return x;
28
  }
29
 
30
  foo(x);
31
}
32
 
33
int main(void)
34
{
35
  if (bar(1) != 1)
36
    abort();
37
 
38
  return 0;
39
}

powered by: WebSVN 2.1.0

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