1 /* { dg-do compile } */
2 /* { dg-require-weak "" } */
3 /* { dg-require-alias "" } */
4 /* { dg-options "-fno-common" } */
6 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1a" } } */
7 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1b" } } */
8 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1c" } } */
9 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1d" } } */
10 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1e" } } */
11 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1f" } } */
12 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1g" } } */
13 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1h" } } */
14 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1i" } } */
15 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1j" } } */
16 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1k" } } */
17 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?vfoo1l" } } */
19 /* test variable addresses with __attribute__ ((weak)) */
21 extern int vfoo1a
__attribute__((weak
));
25 return (void *)&vfoo1a
;
30 extern int vfoo1b
__attribute__((weak
));
33 return (void *)&vfoo1b
;
40 return (void *)&vfoo1c
;
42 extern int vfoo1c
__attribute__((weak
)); /* { dg-warning "unspecified behavior" } */
45 extern int vfoo1d
__attribute__((weak
));
49 return (void *)&vfoo1d
;
54 extern int vfoo1e
__attribute__((weak
));
57 return (void *)&vfoo1e
;
64 return (void *)&vfoo1f
;
66 extern int vfoo1f
__attribute__((weak
)); /* { dg-warning "unspecified behavior" } */
72 return (void *)&vfoo1g
;
74 int vfoo1g
__attribute__((weak
)); /* { dg-warning "unspecified behavior" } */
77 extern int vfoo1h
__attribute__((weak
));
80 return (void *)&vfoo1h
;
82 extern int vfoo1h
__attribute__((weak
));
86 extern int vfoo1i
__attribute__((weak
));
89 return (void *)&vfoo1i
;
91 extern int vfoo1i
__attribute__((weak
));
95 extern int vfoo1j
__attribute__((weak
));
98 return (void *)&vfoo1j
;
101 extern int vfoo1j
__attribute__((weak
));
104 extern int vfoo1k
__attribute__((weak
));
109 extern int vfoo1l
__attribute__((weak
, alias ("vfoox1l")));