1 /* Test class methods inside categories. */
2 /* Author: Ziemowit Laski <zlaski@apple.com>. */
5 /* { dg-xfail-run-if "need OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
7 #include "../objc-obj-c++-shared/TestsuiteObject.m"
8 extern int strcmp(const char *s1, const char *s2);
9 extern void abort(void);
11 #define CHECK_IF(expr) if(!(expr)) abort()
13 @interface MyObject: TestsuiteObject
17 @implementation MyObject
18 + (Class)whatever1 { return [super superclass]; }
21 @interface MyObject (ThisWontCompile)
25 @implementation MyObject (ThisWontCompile)
26 +(Class)whatever2 { return [super superclass]; }
29 int main (int argc, const char * argv[])
31 Class w1 = [MyObject whatever1];
32 Class w2 = [MyObject whatever2];
34 CHECK_IF(!strcmp( object_getClassName( w1 ), "TestsuiteObject"));
35 CHECK_IF(!strcmp( object_getClassName( w2 ), "TestsuiteObject"));