]> git.saurik.com Git - apple/objc4.git/blob - test/imageorder1.m
objc4-818.2.tar.gz
[apple/objc4.git] / test / imageorder1.m
1 #include "test.h"
2 #include "imageorder.h"
3
4 int state = -1;
5 int cstate = 0;
6
7 static void c1(void) __attribute__((constructor));
8 static void c1(void)
9 {
10 testassert(state == 1); // +load before C/C++
11 testassert(cstate == 0);
12 cstate = 1;
13 }
14
15
16 #if __clang__
17 #pragma clang diagnostic push
18 #pragma clang diagnostic ignored "-Wobjc-protocol-method-implementation"
19 #endif
20
21 @implementation Super (cat1)
22 +(void) method {
23 fail("+[Super(cat1) method] not replaced!");
24 }
25 +(void) method1 {
26 state = 1;
27 }
28 +(void) load {
29 testassert(state == 0);
30 state = 1;
31 }
32 @end
33
34 #if __clang__
35 #pragma clang diagnostic pop
36 #endif
37
38
39 @implementation Super
40 +(void) initialize { }
41 +(void) method {
42 fail("+[Super method] not replaced!");
43 }
44 +(void) method0 {
45 state = 0;
46 }
47 +(void) load {
48 testassert(state == -1);
49 state = 0;
50 }
51 @end
52