blob: a82631741534caea15b54c7730f6cbad2435d805 [file] [log] [blame]
John McCalled14ad22011-03-08 04:17:03 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
Anders Carlssonc7c20702008-08-24 16:33:25 +00002static id __attribute((objc_gc(weak))) a;
3static id __attribute((objc_gc(strong))) b;
4
5static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
6static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}}
John McCall80ee5962011-03-02 12:15:05 +00007static id __attribute((objc_gc(foo, 456))) e; // expected-error{{attribute takes one argument}}
Anders Carlssonc7c20702008-08-24 16:33:25 +00008static id __attribute((objc_gc(hello))) f; // expected-warning{{'objc_gc' attribute argument not supported: 'hello'}}
John McCalled14ad22011-03-08 04:17:03 +00009
10static int __attribute__((objc_gc(weak))) g; // expected-warning {{'objc_gc' only applies to pointer types; type here is 'int'}}
11
12static __weak int h; // expected-warning {{'__weak' only applies to pointer types; type here is 'int'}}
John McCall462c0552011-03-08 07:59:04 +000013
14// TODO: it would be great if this reported as __weak
15#define WEAK __weak
16static WEAK int h; // expected-warning {{'objc_gc' only applies to pointer types; type here is 'int'}}
17
18/* expected-warning {{'__weak' only applies to pointer types; type here is 'int'}}*/ static __we\
19ak int i;