]>
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
14 #include "test_support.h"
16 extern bool initsInWrongOrder
;
17 extern bool allInitsDone();
19 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
21 /// This tests that using RTLD_NOLOAD in an initializer does not trigger out of order initializers
23 if ( initsInWrongOrder
)
24 FAIL("wrong init order");
25 else if ( !allInitsDone() )
26 FAIL("all initializers not run");