2 // { dg-require-weak "" }
3 // { dg-require-alias "" }
4 // { dg-options "-O2 -fno-common" }
6 // Copyright 2005 Free Software Foundation, Inc.
7 // Contributed by Alexandre Oliva <aoliva@redhat.com>
11 // The unit-at-a-time call graph code used to fail to emit variables
12 // without external linkage that were only used indirectly, through
13 // aliases. We might then get linker failures because the static
14 // variable was not defined, or run-time errors because the weak alias
15 // ended up pointing somewhere random.
19 static unsigned long lv1
= 0xdeadbeefUL
;
20 #pragma weak Av1a = lv1
21 extern unsigned long Av1a
;
23 static unsigned long lf1(void) { return 0x510bea7UL
; }
24 #pragma weak Af1a = lf1
25 extern unsigned long Af1a(void);
30 || Av1a
!= 0xdeadbeefUL
31 || Af1a() != 0x510bea7UL
)