summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/x86_64/abi/callabi/leaf-2.c
blob: 2a54bc89cfc2abb5204228182aaed42013036988 (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
/* { dg-do compile } */
/* { dg-options "-O2 -mabi=sysv" } */

extern int glb1, gbl2, gbl3;

__attribute__ ((ms_abi))
int foo (void)
{
  int r = 1;
  int i, j, k;
  for (i = 0; i < glb1; i++)
  {
     r *= (i + 1);
     for (j = gbl2; j > 0; --j)
       {
	 for (k = 0; k < gbl3; k++)
	   r += (i + k * j);
       }
  }

  return r;
}

/* { dg-final { scan-assembler-not "%rsp" } } */