#include <stdio.h>
#include <dlfcn_private.h>
#include <stdbool.h>
#include "test_support.h"
extern void test();
int main(int argc, const char* argv[], const char* envp[], const char* apple[])
{
void* handle = dlopen("@rpath/libbar.dylib", RTLD_LAZY);
if ( handle != NULL ) {
FAIL("dlopen(\"@rpath/libbar.dylib\") should not have succeeded");
}
handle = dlopen_from("@rpath/libbar.dylib", RTLD_LAZY, &test);
if ( handle == NULL ) {
FAIL("dlopen_from(\"@rpath/libbar.dylib\", &test) failed: %s", dlerror());
}
handle = dlopen("@loader_path/../dir/libbaz.dylib", RTLD_LAZY);
if ( handle != NULL ) {
FAIL("dlopen(\"@loader_path/../dir/libbaz.dylib\") should not have succeeded");
}
handle = dlopen_from("@loader_path/../dir/libbaz.dylib", RTLD_LAZY, &test);
if ( handle == NULL ) {
FAIL("dlopen_from(\"@loader_path/../dir/libbaz.dylib\", &test) failed: %s", dlerror());
}
PASS("dlopen_from");
}