pr47276.c (ASMNAME, [...]): Define.

* 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.

From-SVN: r179659
This commit is contained in:
Joern Rennecke 2011-10-07 13:52:17 +00:00 committed by Joern Rennecke
parent 68c0ef75f3
commit 14307a72de
4 changed files with 35 additions and 10 deletions

View File

@ -1,3 +1,15 @@
2011-10-06 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.
2011-10-07 Tom de Vries <tom@codesourcery.com>
PR middle-end/50527

View File

@ -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")));

View File

@ -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 @@ void
__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")));

View File

@ -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")));