diff options
Diffstat (limited to 'test/SemaObjC/objc-array-literal.m')
-rw-r--r-- | test/SemaObjC/objc-array-literal.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaObjC/objc-array-literal.m b/test/SemaObjC/objc-array-literal.m index 706207df7482..2971fcc45399 100644 --- a/test/SemaObjC/objc-array-literal.m +++ b/test/SemaObjC/objc-array-literal.m @@ -9,6 +9,18 @@ typedef unsigned long NSUInteger; typedef unsigned int NSUInteger; #endif +void checkNSArrayUnavailableDiagnostic() { + id obj; + id arr = @[obj]; // expected-error {{NSArray must be available to use Objective-C array literals}} +} + +@class NSArray; + +void checkNSArrayFDDiagnostic() { + id obj; + id arr = @[obj]; // expected-error {{declaration of 'arrayWithObjects:count:' is missing in NSArray class}} +} + @class NSString; extern void NSLog(NSString *format, ...) __attribute__((format(__NSString__, 1, 2))); |