1 /* Ensure that the compiler does not emit spurious extern declarations named '_Foo', where 'Foo'
2 is an ObjC class name. */
3 /* Contributed by Ziemowit Laski <zlaski@apple.com>. */
5 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
7 #include "../objc-obj-c++-shared/TestsuiteObject.m"
10 #define CHECK_IF(expr) if(!(expr)) abort()
12 @interface _Child: TestsuiteObject
16 @interface Child: _Child
20 @interface Child (Categ)
24 int _TestsuiteObject = 23; /* Should not conflict with @interface TestsuiteObject. */
26 @implementation _Child
27 + (int) flashCache { return 12 + _TestsuiteObject; }
31 + (int) flushCache1 { return 7 + [super flashCache]; }
34 @implementation Child (Categ)
35 + (int) flushCache2 { return 9 + [super flashCache]; }
39 CHECK_IF([_Child flashCache] == 35);
40 CHECK_IF([Child flushCache1] == 42);
41 CHECK_IF([Child flushCache2] == 44);