RFA: Testsuite: Fixes for PR44197.c

Submitted by Nick Clifton on Oct. 7, 2010, 5:21 p.m.

Details

Message ID m3hbgx2a1y.fsf@redhat.com
State New
Headers show

Commit Message

Nick Clifton Oct. 7, 2010, 5:21 p.m.
Hi Jan, Hi Guys,

  The gcc test gcc.c-torture/compile/pr44197.c has a couple of problems:
  It uses the visibility attribute without checking to see if the target
  supports it, and it assumes that there is no prefix appended to user
  symbols.  The patch below takes care of both of these problems and
  allows the test to compile successfully on an x86 target (which does
  not use a prefix), an ARM target (which does use a prefix), and also
  to be treated as unsupported on a MN10300 target, which does not
  support the visibility attribute.

  OK to apply ?

Cheers
  Nick

gcc/testsuite/ChangeLog
2010-10-07  Nick Clifton  <nickc@redhat.com>

	* gcc.c-torture/compile/pr44197.c: Require visibility support.
        Allow for a user label prefix.

Comments

Richard Henderson Oct. 7, 2010, 5:56 p.m.
On 10/07/2010 10:21 AM, Nick Clifton wrote:
> +#ifndef __USER_LABEL_PREFIX__
> +#define __USER_LABEL_PREFIX__ ""
> +#endif
> +
> +#define xstr(s) str(s)
> +#define str(s) #s
> +#define PREFIX xstr(__USER_LABEL_PREFIX__)

Err, string-izing a string?

Surely that default version of U_L_P should be empty,
or put the ifdef around the entire stringizing bit.


r~

Patch hide | download patch | download mbox

Index: gcc/testsuite/gcc.c-torture/compile/pr44197.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr44197.c	(revision 165080)
+++ gcc/testsuite/gcc.c-torture/compile/pr44197.c	(working copy)
@@ -1,4 +1,14 @@ 
 /* { dg-require-alias "" } */
+/* { dg-require-visibility "" } */
+
+#ifndef __USER_LABEL_PREFIX__
+#define __USER_LABEL_PREFIX__ ""
+#endif
+
+#define xstr(s) str(s)
+#define str(s) #s
+#define PREFIX xstr(__USER_LABEL_PREFIX__)
+
 typedef unsigned short int __uint16_t;
 enum
 {
@@ -12,7 +22,7 @@ 
 extern const __ctype_mask_t *__C_ctype_b;
 extern
 __typeof (__C_ctype_b)
-     __C_ctype_b __asm__ ("" "__GI___C_ctype_b")
+     __C_ctype_b __asm__ (PREFIX "__GI___C_ctype_b")
   __attribute__ ((visibility ("hidden")));
      static const __ctype_mask_t __C_ctype_b_data[] = {
      };