3 $C{COMPILE} $DIR/load-parallel00.m -o load-parallel00.dylib -dynamiclib
4 $C{COMPILE} $DIR/load-parallel.m -x none load-parallel00.dylib -o load-parallel.out -DCOUNT=10
6 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel0.dylib -dynamiclib -DN=0
7 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel1.dylib -dynamiclib -DN=1
8 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel2.dylib -dynamiclib -DN=2
9 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel3.dylib -dynamiclib -DN=3
10 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel4.dylib -dynamiclib -DN=4
11 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel5.dylib -dynamiclib -DN=5
12 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel6.dylib -dynamiclib -DN=6
13 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel7.dylib -dynamiclib -DN=7
14 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel8.dylib -dynamiclib -DN=8
15 $C{COMPILE} $DIR/load-parallel0.m -x none load-parallel00.dylib -o load-parallel9.dylib -dynamiclib -DN=9
25 #error -DCOUNT=c missing
30 void *thread(void *arg)
32 uintptr_t num = (uintptr_t)arg;
35 objc_registerThreadWithCollector();
37 asprintf(&buf, "load-parallel%lu.dylib", (unsigned long)num);
38 testprintf("%s\n", buf);
39 void *dlh = dlopen(buf, RTLD_LAZY);
41 fail("dlopen failed: %s", dlerror());
53 for (i = 0; i < COUNT; i++) {
54 pthread_create(&t[i], NULL, thread, (void *)i);
57 for (i = 0; i < COUNT; i++) {
58 pthread_join(t[i], NULL);
61 testprintf("loaded %d/%d\n", state, COUNT*26);
62 testassert(state == COUNT*26);