From f864dbddcf026827e85d49544abbb002841a5405 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sat, 4 Oct 2008 10:17:17 +0000 Subject: [PATCH] fehler156: aligning the stack does not work. [r22458] --- ir/be/test/fehler156.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ir/be/test/fehler156.c diff --git a/ir/be/test/fehler156.c b/ir/be/test/fehler156.c new file mode 100644 index 000000000..fe030aa00 --- /dev/null +++ b/ir/be/test/fehler156.c @@ -0,0 +1,24 @@ +/*$ -fomit-frame-pointer $*/ + +#include + + +unsigned __attribute__((noinline)) get_sp(void) +{ + unsigned esp; + asm("mov %%esp, %0": "=r" (esp)); + return esp; +} + + +int main(void) +{ +#ifndef __INTEL_COMPILER // ICC does not align the stack + unsigned sp = get_sp(); + if (sp % 16 != 12) { + printf("stack is unaligned after call: 0x%X\n", sp); + return 1; + } +#endif + return 0; +} -- 2.20.1