]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-rpath-implicit.dtest/main.c
dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-rpath-implicit.dtest / main.c
1
2 // BUILD: $CC foo.c -dynamiclib -install_name @rpath/libimplicitrpath.dylib -o $BUILD_DIR/dir1/libimplicitrpath.dylib
3 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-rpath-implicit.exe -rpath @loader_path/dir1
4
5 // RUN: ./dlopen-rpath-implicit.exe
6
7 #include <stdio.h>
8 #include <dlfcn.h>
9
10 #include "test_support.h"
11
12 /// test that a leaf name passed to dlopen() searches the rpath
13
14 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
15 void* handle = dlopen("libimplicitrpath.dylib", RTLD_LAZY);
16 if ( handle == NULL ) {
17 FAIL("dlopen(\"libimplicitrpath.dylib\") failed: %s", dlerror());
18 }
19
20 dlclose(handle);
21 PASS("Succcess");
22 }
23