blob: 4532cccf98d9023a453dfdaca12b72991ee6e274 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -verify -fsyntax-only %s
Daniel Dunbar6e775db2009-03-06 06:39:57 +00002
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);
Mike Stumpd1969d82009-07-22 00:43:08 +00008void __attribute__((weak_import)) g5(void) {
Daniel Dunbar6e775db2009-03-06 06:39:57 +00009}
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
Fariborz Jahanianf23ecd92009-07-16 01:12:24 +000014static int x __attribute__((weak)); // expected-error {{weak declaration of 'x' must be public}}
15