Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 1 | // RUN: %clang -target x86_64-apple-darwin -arch arm64 -mios-version-min=7 -fsyntax-only -Wdeprecated-objc-isa-usage %s -Xclang -verify |
| 2 | // RUN: %clang -target x86_64-apple-darwin -arch arm64 -mios-version-min=7 -fsyntax-only %s -Xclang -verify |
| 3 | // RUN: %clang -target x86_64-apple-darwin -mios-simulator-version-min=7 -fsyntax-only -Wdeprecated-objc-isa-usage %s -Xclang -verify |
Tim Northover | 6f3ff22 | 2015-10-30 16:30:27 +0000 | [diff] [blame] | 4 | // RUN: %clang -target x86_64-apple-darwin -arch armv7k -mwatchos-version-min=2 -fsyntax-only -Wdeprecated-objc-isa-usage %s -Xclang -verify |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 5 | // rdar://10709102 |
Tim Northover | 6f3ff22 | 2015-10-30 16:30:27 +0000 | [diff] [blame] | 6 | // RUN: %clang -target x86_64-apple-darwin -arch x86_64 -fsyntax-only -Wdeprecated-objc-isa-usage %s -Xclang -verify |
Tim Northover | a2ee433 | 2014-03-29 15:09:45 +0000 | [diff] [blame] | 7 | |
| 8 | typedef struct objc_object { |
| 9 | struct objc_class *isa; |
| 10 | } *id; |
| 11 | |
| 12 | @interface NSObject { |
| 13 | struct objc_class *isa; |
| 14 | } |
| 15 | @end |
| 16 | @interface Whatever : NSObject |
| 17 | +self; |
| 18 | @end |
| 19 | |
| 20 | static void func() { |
| 21 | |
| 22 | id x; |
| 23 | |
| 24 | [(*x).isa self]; // expected-error {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}} |
| 25 | [x->isa self]; // expected-error {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}} |
| 26 | } |