]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-RTLD_NOLOAD.dtest/init-main.c
2 // BUILD: $CC init-b.c -dynamiclib -DRUN_DIR="$RUN_DIR" -install_name $RUN_DIR/libInitB.dylib -o $BUILD_DIR/libInitB.dylib
3 // BUILD: $CC init-a.c -dynamiclib -install_name $RUN_DIR/libInitA.dylib $BUILD_DIR/libInitB.dylib -o $BUILD_DIR/libInitA.dylib
4 // BUILD: $CC init-main.c $BUILD_DIR/libInitA.dylib -o $BUILD_DIR/dlopen-RTLD_NOLOAD-in-initializer.exe
6 // RUN: ./dlopen-RTLD_NOLOAD-in-initializer.exe
15 extern bool initsInWrongOrder
;
16 extern bool allInitsDone();
20 printf("[BEGIN] dlopen-RTLD_NOLOAD-in-initializer\n");
23 /// This tests that using RTLD_NOLOAD in an initializer does not trigger out of order initializers
25 if ( initsInWrongOrder
)
26 printf("[FAIL] dlopen-RTLD_NOLOAD-in-initializer: wrong init order\n");
27 else if ( !allInitsDone() )
28 printf("[FAIL] dlopen-RTLD_NOLOAD-in-initializer: all initializers not run\n");
30 printf("[PASS] dlopen-RTLD_NOLOAD-in-initializer\n");