2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / call-1.c
blobbd7c569c69db95fe0e441a9e448e19de58d47b8e
1 /* PR optimization/11304 */
2 /* Originator: <manuel.serrano@sophia.inria.fr> */
3 /* { dg-do run } */
4 /* { dg-options "-O -fomit-frame-pointer" } */
6 /* Verify that %eax is always restored after a call. */
8 extern void abort(void);
10 volatile int r;
12 void set_eax(int val)
14 __asm__ __volatile__ ("mov %0, %%eax" : : "m" (val));
17 void foo(int val)
19 r = val;
22 int bar(int x)
24 if (x)
26 set_eax(0);
27 return x;
30 foo(x);
33 int main(void)
35 if (bar(1) != 1)
36 abort();
38 return 0;