1 /* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */
2 /* { dg-do compile } */
3 /* The use of isa is deprecated, but we still want to test that it works. */
4 /* { dg-additional-options "-Wno-deprecated-declarations" } */
6 #include "../objc-obj-c++-shared/TestsuiteObject.h"
7 #include "../objc-obj-c++-shared/runtime.h"
9 @interface TestsuiteObject (Test)
10 - (Class) test1: (id)object;
13 @interface Derived: TestsuiteObject
14 - (Class) test2: (id)object;
17 @implementation TestsuiteObject (Test)
19 Class test1(id object) {
20 #ifdef __NEXT_RUNTIME__
21 Class cls = object->isa;
23 Class cls = object->class_pointer;
27 - (Class) test1: (id)object {
28 #ifdef __NEXT_RUNTIME__
29 Class cls = object->isa;
31 Class cls = object->class_pointer;
38 @implementation Derived
40 Class test2(id object) {
41 #ifdef __NEXT_RUNTIME__
42 Class cls = object->isa;
44 Class cls = object->class_pointer;
48 - (Class) test2: (id)object {
49 #ifdef __NEXT_RUNTIME__
50 Class cls = object->isa;
52 Class cls = object->class_pointer;
59 Class test3(id object) {
60 #ifdef __NEXT_RUNTIME__
61 Class cls = object->isa;
63 Class cls = object->class_pointer;