summaryrefslogtreecommitdiff
blob: cd616859427aeb759311e25aafba342e0a78798d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* From gcc svn, /branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr66838.c */
/* Copyrighted and distributed under the same terms as gcc */

void abort (void);

char global;

__attribute__((sysv_abi, noinline, noclone))
void sysv_abi_func(char const *desc, void *local)
{
  register int esi asm ("esi");
  register int edi asm ("edi");
  
  if (local != &global)
    abort ();

  /* Clobber some of the extra SYSV ABI registers.  */
  asm volatile ("movl\t%2, %0\n\tmovl\t%2, %1"
		: "=r" (esi), "=r" (edi)
		: "i" (0xdeadbeef));
}

__attribute__((ms_abi, noinline, noclone))
void ms_abi_func ()
{
  sysv_abi_func ("1st call", &global);
  sysv_abi_func ("2nd call", &global);
  sysv_abi_func ("3rd call", &global);
}

int
main(void)
{
  ms_abi_func();
  return 0;
}