diff options
Diffstat (limited to 'gcc/testsuite/gcc.dg/alias-7.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/alias-7.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/alias-7.c b/gcc/testsuite/gcc.dg/alias-7.c new file mode 100644 index 000000000..591c3028e --- /dev/null +++ b/gcc/testsuite/gcc.dg/alias-7.c @@ -0,0 +1,20 @@ +/* { dg-do run } */ +/* { dg-require-alias "" } */ +/* { dg-options "-O2" } */ + +extern void abort (void); + +#define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname) +#define ASMNAME2(prefix, cname) STRING (prefix) cname +#define STRING(x) #x + +int foo __asm__ (ASMNAME ("foo")) __attribute__((nocommon)); +extern __typeof (foo) bar __attribute__ ((weak, alias ("foo"))); + +int +main (void) +{ + if (&foo != &bar || foo || bar) + abort (); + return bar; +} |