Commit f864dbdd authored by Christoph Mallon's avatar Christoph Mallon
Browse files

fehler156: aligning the stack does not work.

[r22458]
parent 18be1ca2
/*$ -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;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment