1 /* Test the Modern GNU Objective-C Runtime API.
3 This is test 'property', covering all functions starting with 'property'. */
6 /* { dg-skip-if "" { *-*-* } { "-fnext-runtime" } { "" } } */
8 /* To get the modern GNU Objective-C Runtime API, you include
10 #include <objc/runtime.h>
15 @interface MyRootClass
21 @implementation MyRootClass
22 + alloc { return class_createInstance (self, 0); }
23 - init { return self; }
30 @protocol MySecondProtocol
31 - (id) setVariable: (id)value;
34 @interface MySubClass : MyRootClass <MyProtocol>
36 - (void) setVariable: (id)value;
40 @implementation MySubClass
41 - (void) setVariable: (id)value { variable_ivar = value; }
42 - (id) variable { return variable_ivar; }
48 /* Functions are tested in alphabetical order. */
50 /* TODO: Test new ABI (when available). */
51 std::cout << "Testing property_getAttributes () ...\n";
53 if (property_getAttributes (NULL) != NULL)
57 /* TODO: Test new ABI (when available). */
58 std::cout << "Testing property_getName () ...\n";
60 if (property_getName (NULL) != NULL)