fehler156: aligning the stack does not work.
authorChristoph Mallon <christoph.mallon@gmx.de>
Sat, 4 Oct 2008 10:17:17 +0000 (10:17 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Sat, 4 Oct 2008 10:17:17 +0000 (10:17 +0000)
[r22458]

ir/be/test/fehler156.c [new file with mode: 0644]

diff --git a/ir/be/test/fehler156.c b/ir/be/test/fehler156.c
new file mode 100644 (file)
index 0000000..fe030aa
--- /dev/null
@@ -0,0 +1,24 @@
+/*$ -fomit-frame-pointer $*/
+
+#include <stdio.h>
+
+
+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;
+}