Commit ee41cff4 by Eric Botcazou Committed by Eric Botcazou

* gcc.dg/i386-call-1.c: New test.

From-SVN: r68892
parent fa5b060f
2003-07-03 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/i386-call-1.c: New test.
2003-07-03 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9162
......
/* PR optimization/11304 */
/* Originator: <manuel.serrano@sophia.inria.fr> */
/* { dg-do run { target i?86-*-* } } */
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment