7 #include <objc/objc-runtime.h>
9 @interface Super : TestRoot {
14 @property(readonly) char superProp;
18 @synthesize superProp = superIvar;
22 @interface Sub : Super {
26 @property(readonly) uintptr_t subProp;
30 @synthesize subProp = subIvar;
37 Runtime layout of Sub:
45 prop = class_getProperty([Sub class], "subProp");
48 prop = class_getProperty([Super class], "superProp");
50 testassert(prop == class_getProperty([Sub class], "superProp"));
52 prop = class_getProperty([Super class], "subProp");
55 prop = class_getProperty(object_getClass([Sub class]), "subProp");
59 testassert(NULL == class_getProperty(NULL, "foo"));
60 testassert(NULL == class_getProperty([Sub class], NULL));
61 testassert(NULL == class_getProperty(NULL, NULL));