No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gcc4 / gcc / testsuite / gcc.dg / weak / weak-5.c
bloba8aca2875448cad07389a5d2bc898a7d21568fa5
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));
22 extern int vfoo1a;
23 void * foo1a (void)
25 return (void *)&vfoo1a;
29 extern int vfoo1b;
30 extern int vfoo1b __attribute__((weak));
31 void * foo1b (void)
33 return (void *)&vfoo1b;
37 extern int vfoo1c;
38 void * foo1c (void)
40 return (void *)&vfoo1c;
42 extern int vfoo1c __attribute__((weak)); /* { dg-warning "unspecified behavior" } */
45 extern int vfoo1d __attribute__((weak));
46 int vfoo1d;
47 void * foo1d (void)
49 return (void *)&vfoo1d;
53 int vfoo1e;
54 extern int vfoo1e __attribute__((weak));
55 void * foo1e (void)
57 return (void *)&vfoo1e;
61 int vfoo1f;
62 void * foo1f (void)
64 return (void *)&vfoo1f;
66 extern int vfoo1f __attribute__((weak)); /* { dg-warning "unspecified behavior" } */
69 extern int vfoo1g;
70 void * foo1g (void)
72 return (void *)&vfoo1g;
74 int vfoo1g __attribute__((weak)); /* { dg-warning "unspecified behavior" } */
77 extern int vfoo1h __attribute__((weak));
78 void * foo1h (void)
80 return (void *)&vfoo1h;
82 extern int vfoo1h __attribute__((weak));
83 int vfoo1h;
86 extern int vfoo1i __attribute__((weak));
87 void * foo1i (void)
89 return (void *)&vfoo1i;
91 extern int vfoo1i __attribute__((weak));
92 extern int vfoo1i;
95 extern int vfoo1j __attribute__((weak));
96 void * foo1j (void)
98 return (void *)&vfoo1j;
100 extern int vfoo1j;
101 extern int vfoo1j __attribute__((weak));
104 extern int vfoo1k __attribute__((weak));
105 int vfoo1k = 1;
108 int vfoox1l = 1;
109 extern int vfoo1l __attribute__((weak, alias ("vfoox1l")));