4 #include <objc/objc-exception.h>
5 #include <Foundation/NSObject.h>
7 #if !defined(__OBJC2__)
18 @interface Foo : NSObject @end
19 @interface Bar : NSObject @end
21 @interface Foo (Unimplemented)
25 @implementation Bar @end
29 -(void)check { state++; }
30 +(void)check { testassert(!"caught class object, not instance"); }
34 static void handler(id unused, void *ctx) __attribute__((used));
35 static void handler(id unused __unused, void *ctx __unused)
37 testassert(state == 3); state++;
40 +(BOOL) resolveClassMethod:(SEL)__unused name
42 testassert(state == 1); state++;
43 #if !TARGET_OS_EMBEDDED && !TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
44 objc_addExceptionHandler(&handler, 0);
45 testassert(state == 2);
47 state++; // handler would have done this
61 // unwind exception and alt handler through objc_msgSend()
66 for (i = 0; i < 100000; i++) {
68 testassert(state == 0); state++;
75 testassert(state == 4); state++;
76 testassert(state == 5); [e check]; // state++
83 testassert(state == 6); state++;
85 testassert(state == 7); state = 0;