]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/rpath-weak-missing.dtest/main.c
2 // BOOT_ARGS: dyld_flags=2
4 // BUILD: $CC foo.c -dynamiclib -o $TEMP_DIR/libmissing.dylib -install_name @rpath/libmissing.dylib
5 // BUILD: $CC foo.c -dynamiclib -Wl,-weak_library,$TEMP_DIR/libmissing.dylib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib -rpath $RUN_DIR
6 // BUILD: $CC main.c -o $BUILD_DIR/rpath-weak-missing.exe -DRUN_DIR="$RUN_DIR"
8 // RUN: ./rpath-weak-missing.exe
9 // RUN: DYLD_AMFI_FAKE=0 ./rpath-weak-missing.exe
11 // main prog dlopen()s libfoo.dylib which weak links to @rpath/libmissing.dylib
19 printf("[BEGIN] rpath-weak-missing\n");
21 void* handle
= dlopen(RUN_DIR
"/libfoo.dylib", RTLD_LAZY
);
22 if ( handle
== NULL
) {
23 printf("[FAIL] rpath-weak-missing dlopen(\"%s/libfoo.dylib\") - %s\n", RUN_DIR
, dlerror());
27 printf("[PASS] rpath-weak-missing\n");