aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/i386/990424-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.target/i386/990424-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.target/i386/990424-1.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.target/i386/990424-1.c b/gcc-4.9/gcc/testsuite/gcc.target/i386/990424-1.c
new file mode 100644
index 000000000..dd2913992
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.target/i386/990424-1.c
@@ -0,0 +1,30 @@
+/* Test that stack alignment is preserved with pending_stack_adjust
+ with stdcall functions. */
+
+/* { dg-do run } */
+/* { dg-require-effective-target ia32 } */
+/* { 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 ();
+}