From: Christoph Mallon Date: Sat, 4 Oct 2008 10:17:17 +0000 (+0000) Subject: fehler156: aligning the stack does not work. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f864dbddcf026827e85d49544abbb002841a5405;p=libfirm fehler156: aligning the stack does not work. [r22458] --- 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; +}