]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-rpath-prev.dtest/main.c
2 // BUILD: $CC sub1.c -dynamiclib -install_name @rpath/librpathstatic.dylib -o $BUILD_DIR/dir1/librpathstatic.dylib
3 // BUILD: $CC sub2.c -dynamiclib -install_name @rpath/libdynamic.dylib -o $BUILD_DIR/dir2/libdynamic.dylib $BUILD_DIR/dir1/librpathstatic.dylib
4 // BUILD: $CC foo.c -dynamiclib -install_name $RUN_DIR/libstatic.dylib -o $BUILD_DIR/libstatic.dylib -rpath @loader_path/dir1 $BUILD_DIR/dir1/librpathstatic.dylib
5 // BUILD: $CC main.c $BUILD_DIR/libstatic.dylib -DRUN_DIR="$RUN_DIR" -o $BUILD_DIR/dlopen-rpath-prev.exe
7 // RUN: ./dlopen-rpath-prev.exe
9 // main links with libstatic.dylib which uses rpath to link with dir1/librpathstatic.dylib
10 // main dlopen()s libdynamic.dylib which links with dir1/librpathstatic.dylib, but has no rpath for it and depends on it being already loaded
15 #include "test_support.h"
17 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
18 void* handle
= dlopen(RUN_DIR
"/dir2/libdynamic.dylib", RTLD_LAZY
);
19 if ( handle
== NULL
) {
20 FAIL("dlerror(): %s", dlerror());