4 #include <objc/objc-exception.h>
5 #include <Foundation/NSObject.h>
9 @interface Foo : NSObject @end
10 @interface Bar : NSObject @end
12 @interface Foo (Unimplemented)
16 @implementation Bar @end
20 -(void)check { state++; }
21 +(void)check { testassert(!"caught class object, not instance"); }
25 static void handler(id unused, void *ctx) __attribute__((used));
26 static void handler(id unused __unused, void *ctx __unused)
28 testassert(state == 3); state++;
31 +(BOOL) resolveClassMethod:(SEL)__unused name
33 testassert(state == 1); state++;
35 objc_addExceptionHandler(&handler, 0);
36 testassert(state == 2);
38 state++; // handler would have done this
50 // unwind exception and alt handler through objc_msgSend()
54 const int count = is_guardmalloc() ? 1000 : 100000;
56 for (int i = 0; i < count; i++) {
58 testassert(state == 0); state++;
65 testassert(state == 4); state++;
66 testassert(state == 5); [e check]; // state++
73 testassert(state == 6); state++;
75 testassert(state == 7); state = 0;