1 /* { dg-do compile { target *-*-darwin* } } */
2 // { dg-require-weak "" }
3 // { dg-options "-O2" }
4 // { dg-options "-O2 -mmacosx-version-min=10.2" { target { powerpc-*-darwin* } } }
5 /* { dg-final { scan-assembler "weak_reference _wv1" } } */
6 /* { dg-final { scan-assembler "weak_reference _wf1" } } */
7 /* { dg-final { scan-assembler-not "weak_reference _w.2" } } */
8 
9 
10 typedef int vtype;
11 
12 extern vtype wv1;
13 static vtype Wv1a __attribute__((weakref ("wv1")));
14 vtype *pv1a = &Wv1a;
15 
16 extern vtype wv2;
17 static vtype Wv2a __attribute__((weakref ("wv2")));
18 vtype *pv2a = &wv2;
19 
20 typedef void ftype(void);
21 
22 extern ftype wf1;
23 static ftype Wf1a __attribute__((weakref ("wf1")));
24 ftype *pf1a = &Wf1a;
25 
26 extern ftype wf2;
27 static ftype Wf2a __attribute__((weakref ("wf2")));
28 ftype *pf2a = &wf2;
29