PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr66838.c
blob46effedad3bcc2299704be8bd73741dc981396e0
1 /* { dg-do run { target lp64 } } */
2 /* { dg-options "-O2" } */
4 void abort (void);
6 char global;
8 __attribute__((sysv_abi, noinline, noclone))
9 void sysv_abi_func(char const *desc, void *local)
11 register int esi asm ("esi");
12 register int edi asm ("edi");
14 if (local != &global)
15 abort ();
17 /* Clobber some of the extra SYSV ABI registers. */
18 asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1"
19 : "=r" (esi), "=r" (edi)
20 : "i" (0xdeadbeef));
23 __attribute__((ms_abi, noinline, noclone))
24 void ms_abi_func ()
26 sysv_abi_func ("1st call", &global);
27 sysv_abi_func ("2nd call", &global);
28 sysv_abi_func ("3rd call", &global);
31 int
32 main(void)
34 ms_abi_func();
35 return 0;