]> git.saurik.com Git - apple/objc4.git/blob - test/load-reentrant2.m
objc4-493.9.tar.gz
[apple/objc4.git] / test / load-reentrant2.m
1 #include "test.h"
2
3 int state2 = 0;
4 extern int state1;
5
6 static void ctor(void) __attribute__((constructor));
7 static void ctor(void)
8 {
9 // should be called during One's dlopen(), before Two's +load
10 testassert(state1 == 111);
11 testassert(state2 == 0);
12 }
13
14 @interface Two @end
15 @implementation Two
16 +(void) load
17 {
18 // Does not run until One's +load completes
19 testassert(state1 == 1);
20 state2 = 2;
21 }
22 @end