2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / alias-7.c
blob591c3028e03712f9146e802add48f92f71653206
1 /* { dg-do run } */
2 /* { dg-require-alias "" } */
3 /* { dg-options "-O2" } */
5 extern void abort (void);
7 #define ASMNAME(cname) ASMNAME2 (__USER_LABEL_PREFIX__, cname)
8 #define ASMNAME2(prefix, cname) STRING (prefix) cname
9 #define STRING(x) #x
11 int foo __asm__ (ASMNAME ("foo")) __attribute__((nocommon));
12 extern __typeof (foo) bar __attribute__ ((weak, alias ("foo")));
14 int
15 main (void)
17 if (&foo != &bar || foo || bar)
18 abort ();
19 return bar;