RFA: Testsuite fixes (3/3): USER_LABEL_PREFIX
diff mbox

Message ID 20110801010130.uzcua5mvc4k4ws88-nzlynne@webmail.spamcop.net
State New
Headers show

Commit Message

Joern Rennecke Aug. 1, 2011, 5:01 a.m. UTC
We have some new tests that use assembler names without regard to
USER_LABEL_PREFIX.  These tests fail for targets with non-empty
USER_LABEL_PREFIX during the assembly phase.

Fixed by using ASMNAME macro like in e.g. gcc.dg/alias-7.c .

Regression tested with x86_64-unknown-linux-gnu X sh-elf .
This fixes 15 spurious FAILures, giving 27 more expected PASSes.
2011-07-26  Joern Rennecke <joern.rennecke@embecosm.com>

	* gcc.dg/pr47276.c (ASMNAME, ASMNAME2, STRING): Define.
	(__EI___vsyslog_chk, __EI_syslog, __EI_vsyslog): Use ASMNAME.  
	(syslog, vsyslog, __vsyslog_chk): Likewise.

	* gcc.dg/lto/20081222_1.c (ASMNAME, ASMNAME2, STRING): Define.
	(x, EXT_x): Use ASMNAME.

	* gcc.dg/torture/pr48044.c (ASMNAME, ASMNAME2, STRING): Define.
	(a, c): Use ASMNAME.

Patch
diff mbox

Index: gcc.dg/lto/20081222_1.c
===================================================================
--- gcc.dg/lto/20081222_1.c	(.../GNU/fsf-gcc/trunk/gcc/testsuite)	(revision 2013)
+++ gcc.dg/lto/20081222_1.c	(.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite)	(revision 2013)
@@ -1,8 +1,12 @@ 
 #include "20081222_0.h"
 
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x)    #x
+
 /* Actually, call "x" "INT_X", and make it hidden.  */
 extern __typeof (x) x
-	__asm__ ("INT_x")
+	__asm__ (ASMNAME ("INT_x"))
 	__attribute__ ((__visibility__ ("hidden")));
 
 int x ()
@@ -12,5 +16,5 @@  int x ()
 
 /* Make an externally-visible symbol "X" that's an alias for INT_x.  */
 extern __typeof (x) EXT_x
-	__asm__ ("x")
+	__asm__ (ASMNAME ("x"))
 	__attribute__ ((__alias__ ("INT_x")));
Index: gcc.dg/torture/pr48044.c
===================================================================
--- gcc.dg/torture/pr48044.c	(.../GNU/fsf-gcc/trunk/gcc/testsuite)	(revision 2013)
+++ gcc.dg/torture/pr48044.c	(.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite)	(revision 2013)
@@ -2,6 +2,10 @@ 
 /* { dg-do compile } */
 /* { dg-require-alias "" } */
 
-int a __asm__ ("b") = 0;
-extern int c __asm__ ("a") __attribute__ ((alias ("b")));
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x)    #x
+
+int a __asm__ (ASMNAME ("b")) = 0;
+extern int c __asm__ (ASMNAME ("a")) __attribute__ ((alias ("b")));
 extern int d __attribute__ ((weak, alias ("a")));
Index: gcc.dg/pr47276.c
===================================================================
--- gcc.dg/pr47276.c	(.../GNU/fsf-gcc/trunk/gcc/testsuite)	(revision 2013)
+++ gcc.dg/pr47276.c	(.../Customer-Projects/X/branches/Y-20110628/toolchain/gcc-4.7.0-20110701/gcc/testsuite)	(revision 2013)
@@ -1,6 +1,11 @@ 
 /* { dg-do compile } */
 /* { dg-require-alias "" } */
 /* { dg-require-visibility "" } */
+
+#define ASMNAME(cname)  ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+#define ASMNAME2(prefix, cname) STRING (prefix) cname
+#define STRING(x)    #x
+
 extern void syslog (int __pri, __const char *__fmt, ...)
      __attribute__ ((__format__ (__printf__, 2, 3)));
 extern void vsyslog (int __pri, __const char *__fmt, int __ap)
@@ -17,15 +22,15 @@  __syslog_chk(int pri, int flag, const ch
 __vsyslog_chk(int pri, int flag, const char *fmt, int ap)
 {
 }
-extern __typeof (__vsyslog_chk) __EI___vsyslog_chk __asm__("" "__vsyslog_chk"); extern __typeof (__vsyslog_chk) __EI___vsyslog_chk __attribute__((alias ("" "__GI___vsyslog_chk")));
+extern __typeof (__vsyslog_chk) __EI___vsyslog_chk __asm__("" ASMNAME ("__vsyslog_chk")); extern __typeof (__vsyslog_chk) __EI___vsyslog_chk __attribute__((alias ("" "__GI___vsyslog_chk")));
 void
 __syslog(int pri, const char *fmt, ...)
 {
 }
 extern __typeof (__syslog) syslog __attribute__ ((alias ("__syslog")));
-extern __typeof (syslog) __EI_syslog __asm__("" "syslog"); extern __typeof (syslog) __EI_syslog __attribute__((alias ("" "__GI_syslog")));
+extern __typeof (syslog) __EI_syslog __asm__("" ASMNAME ("syslog")); extern __typeof (syslog) __EI_syslog __attribute__((alias ("" "__GI_syslog")));
 extern __typeof (__vsyslog) vsyslog __attribute__ ((alias ("__vsyslog")));
-extern __typeof (vsyslog) __EI_vsyslog __asm__("" "vsyslog"); extern __typeof (vsyslog) __EI_vsyslog __attribute__((alias ("" "__GI_vsyslog")));
-extern __typeof (syslog) syslog __asm__ ("" "__GI_syslog") __attribute__ ((visibility ("hidden")));
-extern __typeof (vsyslog) vsyslog __asm__ ("" "__GI_vsyslog") __attribute__ ((visibility ("hidden")));
-extern __typeof (__vsyslog_chk) __vsyslog_chk __asm__ ("" "__GI___vsyslog_chk") __attribute__ ((visibility ("hidden")));
+extern __typeof (vsyslog) __EI_vsyslog __asm__("" ASMNAME ("vsyslog")); extern __typeof (vsyslog) __EI_vsyslog __attribute__((alias ("" "__GI_vsyslog")));
+extern __typeof (syslog) syslog __asm__ ("" ASMNAME ("__GI_syslog")) __attribute__ ((visibility ("hidden")));
+extern __typeof (vsyslog) vsyslog __asm__ ("" ASMNAME ("__GI_vsyslog")) __attribute__ ((visibility ("hidden")));
+extern __typeof (__vsyslog_chk) __vsyslog_chk __asm__ ("" ASMNAME ("__GI___vsyslog_chk")) __attribute__ ((visibility ("hidden")));