1 /* Test that all pending instantiations have taken place before meta-data
3 /* Author: Fariborz Jahanian <fjahanian@apple.com> */
4 /* Adapted by Nicola Pero <nicola.pero@meta-innovation.com> */
6 /* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
7 /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */
10 #include <objc/runtime.h>
12 @interface MyRootClass
20 @implementation MyRootClass
21 + (id) initialize { return self; }
22 + alloc { return class_createInstance (self, 0); }
23 - init { return self; }
24 - doSomething { return self; }
33 void destroy() { delete this; }
37 class Subclass : public T
44 [[[MyRootClass alloc] init] doSomething];
48 int main(int argc, const char * argv[])
50 Subclass<Base>* theSubclass = new Subclass<Base>();
51 theSubclass->destroy();