1 /* { dg-do run { target lp64 } } */
2 /* { dg-options "-O2" } */
3
4 void abort (void);
5
6 char global;
7
8 __attribute__((sysv_abi, noinline, noclone))
sysv_abi_func(char const * desc,void * local)9 void sysv_abi_func(char const *desc, void *local)
10 {
11 register int esi asm ("esi");
12 register int edi asm ("edi");
13
14 if (local != &global)
15 abort ();
16
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));
21 }
22
23 __attribute__((ms_abi, noinline, noclone))
ms_abi_func()24 void ms_abi_func ()
25 {
26 sysv_abi_func ("1st call", &global);
27 sysv_abi_func ("2nd call", &global);
28 sysv_abi_func ("3rd call", &global);
29 }
30
31 int
main(void)32 main(void)
33 {
34 ms_abi_func();
35 return 0;
36 }
37