aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c b/gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c
index 38586fe97..daad319c3 100644
--- a/gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c
+++ b/gcc-4.8/gcc/testsuite/gcc.target/i386/pr9771-1.c
@@ -45,7 +45,17 @@ void test(void)
exit(0);
}
-int main()
+/* main usually performs dynamic realignment of the stack in case
+ _start would fail to properly align the stack, but for dynamic
+ stack realignment we need frame pointer which is incompatible
+ with -ffixed-ebp and the global register var. So, cheat here
+ and hide from the compiler that main is really main. */
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+int real_main() __asm (ASMNAME ("main"));
+
+int real_main()
{
test();
return 0;