This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
gcc.dg/asm-names-1.c
- To: gcc patches <gcc-patches at gcc dot gnu dot org>
- Subject: gcc.dg/asm-names-1.c
- From: Aldy Hernandez <aldyh at redhat dot com>
- Date: 26 Aug 2001 08:15:28 +0300
hi guys.
main is calling __main in expand_main_function() (well, when NAME__MAIN
is defined to "__main").
since asm-names-1.c is compiled with -fleading-underscore, gcc will
prepend a "_" to __main and we end up with three leading underscores.
This causes the testcase not to link because it can't find ___main.
This patch adds a dummy ___main to appease the linker, and it fixes the
failure on mips.
[i actually don't like this testcase at all. any port that defines
NAME__MAIN to something else will fail this testcase, even with the
patch below. is this test really necessary?]
Ok to install?
--
Aldy Hernandez E-mail: aldyh@redhat.com
Professional Gypsy and Camel Trader
Red Hat, Inc.
2001-08-25 Aldy Hernandez <aldyh@redhat.com>
* gcc.dg/asm-names.c (ymain): New.
Index: asm-names.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/gcc.dg/asm-names.c,v
retrieving revision 1.1
diff -c -r1.1 asm-names.c
*** asm-names.c 2000/09/11 05:44:51 1.1
--- asm-names.c 2001/08/26 05:08:36
***************
*** 21,23 ****
--- 21,27 ----
extern int xmain (void) asm ("main");
int xmain (void) { return main(); }
+
+ /* In case built where the runtime calls __main. */
+ extern int ymain (void) asm ("___main");
+ int ymain (void) { return 0; }