Quellcode durchsuchen

Improving objc_ownership attribute test coverage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189731 91177308-0d34-0410-b5e6-96231b3b80d8
Aaron Ballman vor 12 Jahren
Ursprung
Commit
0180688aaa
1 geänderte Dateien mit 6 neuen und 0 gelöschten Zeilen
  1. 6 0
      test/SemaObjC/arc-decls.m

+ 6 - 0
test/SemaObjC/arc-decls.m

@@ -99,3 +99,9 @@ void test7(void) {
   I *y;
   I *y;
   J **py = &y; // expected-error {{pointer to non-const type 'J *' with no explicit ownership}} expected-warning {{incompatible pointer types initializing}}
   J **py = &y; // expected-error {{pointer to non-const type 'J *' with no explicit ownership}} expected-warning {{incompatible pointer types initializing}}
 }
 }
+
+void func(void) __attribute__((objc_ownership(none)));  // expected-warning {{'objc_ownership' only applies to Objective-C object or block pointer types; type here is 'void (void)'}}
+struct __attribute__((objc_ownership(none))) S2 {}; // expected-error {{'objc_ownership' attribute only applies to variables}}
+@interface I2
+    @property __attribute__((objc_ownership(frob))) id i; // expected-warning {{'objc_ownership' attribute argument not supported: 'frob'}}
+@end