]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-intertwined.dtest/main.c
11580d31c34195689d4b73df5e68646eed56f149
3 // BUILD: $CC base.c -dynamiclib -o $BUILD_DIR/libbase.dylib -install_name $RUN_DIR/libbase.dylib
4 // BUILD: $CC A.c -dynamiclib -o $BUILD_DIR/libA.dylib -install_name $RUN_DIR/libA.dylib $BUILD_DIR/libbase.dylib
5 // BUILD: $CC C.c -dynamiclib -o $BUILD_DIR/libC.dylib -install_name $RUN_DIR/libC.dylib $BUILD_DIR/libbase.dylib
6 // BUILD: $CC B.c -dynamiclib -o $BUILD_DIR/libB.dylib -install_name $RUN_DIR/libB.dylib $BUILD_DIR/libbase.dylib $BUILD_DIR/libC.dylib
7 // BUILD: $CC D.c -dynamiclib -o $BUILD_DIR/libD.dylib -install_name $RUN_DIR/libD.dylib $BUILD_DIR/libbase.dylib $BUILD_DIR/libC.dylib
8 // BUILD: $CC E.c -dynamiclib -o $BUILD_DIR/libE.dylib -install_name $RUN_DIR/libE.dylib $BUILD_DIR/libbase.dylib $BUILD_DIR/libA.dylib
9 // BUILD: $CC F.c -dynamiclib -o $BUILD_DIR/libF.dylib -install_name $RUN_DIR/libF.dylib $BUILD_DIR/libbase.dylib $BUILD_DIR/libD.dylib
10 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-intertwined.exe $BUILD_DIR/libbase.dylib $BUILD_DIR/libA.dylib -DRUN_DIR="$RUN_DIR"
12 // RUN: ./dlopen-intertwined.exe
17 #include <dispatch/dispatch.h>
20 // main dlopens B which deps on C
21 // main dlopens D which deps on C
22 // main dlopens E which deps on A
23 // main dlopens F which deps on D
25 extern void a(const char*);
26 extern void setState(const char* from
);
30 printf("[BEGIN] dlopen-intertwined\n");
34 void* handle
= dlopen(RUN_DIR
"/libB.dylib", RTLD_LAZY
);
35 if ( handle
== NULL
) {
36 printf("[FAIL] dlopen-intertwined: %s\n", dlerror());
40 handle
= dlopen(RUN_DIR
"/libD.dylib", RTLD_LAZY
);
41 if ( handle
== NULL
) {
42 printf("[FAIL] dlopen-intertwined: %s\n", dlerror());
46 handle
= dlopen(RUN_DIR
"/libE.dylib", RTLD_LAZY
);
47 if ( handle
== NULL
) {
48 printf("[FAIL] dlopen-intertwined: %s\n", dlerror());
52 handle
= dlopen(RUN_DIR
"/libF.dylib", RTLD_LAZY
);
53 if ( handle
== NULL
) {
54 printf("[FAIL] dlopen-intertwined: %s\n", dlerror());
60 printf("[PASS] dlopen-intertwined\n");