1 /* { dg-do compile } */
2 /* { dg-require-weak "" } */
3 /* { dg-options "-fno-common" } */
4 /* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
5
6 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?a" } } */
7 /* { dg-final { scan-assembler-not "weak\[^ \t\]*\[ \t\]_?b" } } */
8 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?c" } } */
9 /* { dg-final { scan-assembler "weak\[^ \t\]*\[ \t\]_?d" } } */
10
11 #pragma weak a
12 extern char a[];
13
user_a(void)14 char *user_a(void)
15 {
16 return a+1;
17 }
18
19 int x;
b(int y)20 int extern inline b(int y)
21 {
22 return x+y;
23 }
24
25 extern int b(int y);
26
user_b(int z)27 int user_b(int z)
28 {
29 return b(z);
30 }
31
32 #pragma weak c
33 extern int c;
34
35 int *user_c = &c;
36
37 #pragma weak d
38 extern char d[];
39
40 char *user_d = &d[1];
41