summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/alias-7.c
blob: 591c3028e03712f9146e802add48f92f71653206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
}