attr-weak.c revision 6e775dbafba2ab6634decc489eb3b4301b4b506b
1// RUN: clang -verify -fsyntax-only %s
2
3extern int g0 __attribute__((weak));
4extern int g1 __attribute__((weak_import));
5int g2 __attribute__((weak));
6int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
7int __attribute__((weak_import)) g4(void);
8int __attribute__((weak_import)) g5(void) {
9}
10
11struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variable and function types}}
12struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variable and function types}}
13
14