aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/990424-1.c
blob: 9a3b630554e6367c07bc05602cc16b820591e762 (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
/* Test that stack alignment is preserved with pending_stack_adjust
   with stdcall functions.  */

/* { dg-do run { target i?86-*-* } } */
/* { dg-forbid-option "-m64" } */
/* { dg-options -mpreferred-stack-boundary=4 } */

void __attribute__((stdcall)) foo(int a, int b, int c);

extern void abort (void);
extern void exit (int);

int
main ()
{
  foo(1, 2, 3);
  foo(1, 2, 3);
  exit (0);
}

void __attribute__((stdcall))
foo(int a, int b, int c)
{
  static int last_align = -1;
  int dummy, align = (int)&dummy & 15;
  if (last_align < 0)
    last_align = align;
  else if (align != last_align)
    abort ();
}