1 // TEST_CFLAGS -framework Foundation
3 #import <Foundation/Foundation.h>
4 #import <objc/runtime.h>
5 #import <objc/objc-gdb.h>
9 @interface Foo : NSObject
16 - (void) test: __attribute__((unused)) sender
19 Method foo = class_getInstanceMethod([Foo class], @selector(foo));
20 IMP fooIMP = method_getImplementation(foo);
21 const char *fooTypes = method_getTypeEncoding(foo);
23 NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
25 sprintf(newSELName, "a%u", x++);
26 SEL newSEL = sel_registerName(newSELName);
27 class_addMethod([Foo class], newSEL, fooIMP, fooTypes);
28 [self performSelector: newSEL];
35 NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
36 [NSThread detachNewThreadSelector: @selector(test:) toTarget: [Foo new] withObject: nil];
38 unsigned int lockCount = 0;
40 if (gdb_objc_isRuntimeLocked())
47 fail("Runtime not locked very much.");