r180056 - Rename this test to make it more general for including more tests.
Ted Kremenek
kremenek at apple.com
Mon Apr 22 15:09:21 PDT 2013
Author: kremenek
Date: Mon Apr 22 17:09:21 2013
New Revision: 180056
URL: http://llvm.org/viewvc/llvm-project?rev=180056&view=rev
Log:
Rename this test to make it more general for including more tests.
Added:
cfe/trunk/test/SemaObjC/deprecated-objc-introspection.m
- copied, changed from r180055, cfe/trunk/test/SemaObjC/warn-isa-ref.m
Removed:
cfe/trunk/test/SemaObjC/warn-isa-ref.m
Copied: cfe/trunk/test/SemaObjC/deprecated-objc-introspection.m (from r180055, cfe/trunk/test/SemaObjC/warn-isa-ref.m)
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/deprecated-objc-introspection.m?p2=cfe/trunk/test/SemaObjC/deprecated-objc-introspection.m&p1=cfe/trunk/test/SemaObjC/warn-isa-ref.m&r1=180055&r2=180056&rev=180056&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/warn-isa-ref.m (original)
+++ cfe/trunk/test/SemaObjC/deprecated-objc-introspection.m Mon Apr 22 17:09:21 2013
@@ -1,4 +1,10 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
+
+//====------------------------------------------------------------====//
+// Test deprecated direct usage of the 'isa' pointer.
+//====------------------------------------------------------------====//
+
+typedef unsigned long NSUInteger;
typedef struct objc_object {
struct objc_class *isa;
Removed: cfe/trunk/test/SemaObjC/warn-isa-ref.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/warn-isa-ref.m?rev=180055&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/warn-isa-ref.m (original)
+++ cfe/trunk/test/SemaObjC/warn-isa-ref.m (removed)
@@ -1,83 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
-
-typedef struct objc_object {
- struct objc_class *isa;
-} *id;
-
- at interface NSObject {
- id firstobj;
- struct objc_class *isa;
-}
- at end
- at interface Whatever : NSObject
-+self;
- at end
-
-static void func() {
-
- id x;
-
- // rdar://8290002
- [(*x).isa self]; // expected-warning {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
- [x->isa self]; // expected-warning {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
-
- Whatever *y;
-
- // GCC allows this, with the following warning:
- // instance variable 'isa' is @protected; this will be a hard error in the future
- //
- // FIXME: see if we can avoid the warning that follows the error.
- [(*y).isa self]; // expected-error {{instance variable 'isa' is protected}} \
- expected-warning{{receiver type 'struct objc_class *' is not 'id' or interface pointer, consider casting it to 'id'}}
- [y->isa self]; // expected-error {{instance variable 'isa' is protected}} \
- expected-warning{{receiver type 'struct objc_class *' is not 'id' or interface pointer, consider casting it to 'id'}}
-}
-
-// rdar://11702488
-// If an ivar is (1) the first ivar in a root class and (2) named `isa`,
-// then it should get the same warnings that id->isa gets.
-
- at interface BaseClass {
- at public
- Class isa; // expected-note 4 {{instance variable is declared here}}
-}
- at end
-
- at interface OtherClass {
- at public
- id firstIvar;
- Class isa; // note, not first ivar;
-}
- at end
-
- at interface Subclass : BaseClass @end
-
- at interface SiblingClass : BaseClass @end
-
- at interface Root @end
-
- at interface hasIsa : Root {
- at public
- Class isa; // note, isa is not in root class
-}
- at end
-
- at implementation Subclass
--(void)method {
- hasIsa *u;
- id v;
- BaseClass *w;
- Subclass *x;
- SiblingClass *y;
- OtherClass *z;
- (void)v->isa; // expected-warning {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
- (void)w->isa; // expected-warning {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
- (void)x->isa; // expected-warning {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
- (void)y->isa; // expected-warning {{direct access to Objective-C's isa is deprecated in favor of object_getClass()}}
- (void)z->isa;
- (void)u->isa;
-
- w->isa = 0; // expected-warning {{assignment to Objective-C's isa is deprecated in favor of object_setClass()}}
-}
- at end
-
More information about the cfe-commits
mailing list