This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Committed: fix gcc.dg/lto/pr59626 for __USER_LABEL_PREFIX__ targets
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Dec 2014 02:42:25 +0100
- Subject: Committed: fix gcc.dg/lto/pr59626 for __USER_LABEL_PREFIX__ targets
- Authentication-results: sourceware.org; auth=none
The lto/pr59626 tests, started regressing for cris-elf on trunk
with a commit in the range 218651:218661. Looks like a bug was
fixed, exposing a bug in the test-case; an assumption that the
mapping of a function C name to assembly name does not prefix
the name with any decoration. (Typically, an underscore is
prepended for targets where that is false, like for cris-elf.)
Other tests have the obvious solution. Copy-pasted from
gcc.dg/lto/pr46940_0.c and committed as obvious.
* gcc.dg/lto/pr59626_0.c (ASMNAME, ASMNAME2, STRING): Define.
(__atoi): Use ASMNAME.
Index: gcc.dg/lto/pr59626_0.c
===================================================================
--- gcc.dg/lto/pr59626_0.c (revision 219095)
+++ gcc.dg/lto/pr59626_0.c (working copy)
@@ -1,6 +1,10 @@
/* { dg-lto-do run } */
-int __atoi (const char *) __asm__("atoi");
+#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x) #x
+
+int __atoi (const char *) __asm__(ASMNAME ("atoi"));
extern inline __attribute__((always_inline,gnu_inline))
int atoi (const char *x)
{
brgds, H-P