Commit 14307a72 by Joern Rennecke Committed by Joern Rennecke

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
parent 68c0ef75
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> 2011-10-07 Tom de Vries <tom@codesourcery.com>
PR middle-end/50527 PR middle-end/50527
......
#include "20081222_0.h" #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. */ /* Actually, call "x" "INT_X", and make it hidden. */
extern __typeof (x) x extern __typeof (x) x
__asm__ ("INT_x") __asm__ (ASMNAME ("INT_x"))
__attribute__ ((__visibility__ ("hidden"))); __attribute__ ((__visibility__ ("hidden")));
int x () int x ()
...@@ -12,5 +16,5 @@ int x () ...@@ -12,5 +16,5 @@ int x ()
/* Make an externally-visible symbol "X" that's an alias for INT_x. */ /* Make an externally-visible symbol "X" that's an alias for INT_x. */
extern __typeof (x) EXT_x extern __typeof (x) EXT_x
__asm__ ("x") __asm__ (ASMNAME ("x"))
__attribute__ ((__alias__ ("INT_x"))); __attribute__ ((__alias__ ("INT_x")));
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-alias "" } */ /* { dg-require-alias "" } */
/* { dg-require-visibility "" } */ /* { 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, ...) extern void syslog (int __pri, __const char *__fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3))); __attribute__ ((__format__ (__printf__, 2, 3)));
extern void vsyslog (int __pri, __const char *__fmt, int __ap) extern void vsyslog (int __pri, __const char *__fmt, int __ap)
...@@ -17,15 +22,15 @@ void ...@@ -17,15 +22,15 @@ void
__vsyslog_chk(int pri, int flag, const char *fmt, int ap) __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 void
__syslog(int pri, const char *fmt, ...) __syslog(int pri, const char *fmt, ...)
{ {
} }
extern __typeof (__syslog) syslog __attribute__ ((alias ("__syslog"))); 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) vsyslog __attribute__ ((alias ("__vsyslog")));
extern __typeof (vsyslog) __EI_vsyslog __asm__("" "vsyslog"); extern __typeof (vsyslog) __EI_vsyslog __attribute__((alias ("" "__GI_vsyslog"))); extern __typeof (vsyslog) __EI_vsyslog __asm__("" ASMNAME ("vsyslog")); extern __typeof (vsyslog) __EI_vsyslog __attribute__((alias ("" "__GI_vsyslog")));
extern __typeof (syslog) syslog __asm__ ("" "__GI_syslog") __attribute__ ((visibility ("hidden"))); extern __typeof (syslog) syslog __asm__ ("" ASMNAME ("__GI_syslog")) __attribute__ ((visibility ("hidden")));
extern __typeof (vsyslog) vsyslog __asm__ ("" "__GI_vsyslog") __attribute__ ((visibility ("hidden"))); extern __typeof (vsyslog) vsyslog __asm__ ("" ASMNAME ("__GI_vsyslog")) __attribute__ ((visibility ("hidden")));
extern __typeof (__vsyslog_chk) __vsyslog_chk __asm__ ("" "__GI___vsyslog_chk") __attribute__ ((visibility ("hidden"))); extern __typeof (__vsyslog_chk) __vsyslog_chk __asm__ ("" ASMNAME ("__GI___vsyslog_chk")) __attribute__ ((visibility ("hidden")));
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
/* { dg-do compile } */ /* { dg-do compile } */
/* { dg-require-alias "" } */ /* { dg-require-alias "" } */
int a __asm__ ("b") = 0; #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
extern int c __asm__ ("a") __attribute__ ((alias ("b"))); #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"))); extern int d __attribute__ ((weak, alias ("a")));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment