]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-framework-fallback.dtest/main.c
dyld-832.7.1.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-framework-fallback.dtest / main.c
1
2 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-framework-fallback.exe
3
4 // RUN: ./dlopen-framework-fallback.exe
5
6 #include <stdio.h>
7 #include <dlfcn.h>
8
9 #include "test_support.h"
10
11 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
12 // Verify dyld will fallback and look for framework in /System/Library/Frameworks/
13 void* handle = dlopen("/System/Library/BadPath/CoreFoundation.framework/CoreFoundation", RTLD_LAZY);
14 if ( handle == NULL ) {
15 FAIL("dlerror(): %s", dlerror());
16 }
17
18 // validate handle works to find symbols
19 void* sym = dlsym(handle, "CFRetain");
20 if ( sym == NULL ) {
21 FAIL("dlerror(): %s", dlerror());
22 }
23
24 PASS("Success");
25
26 return 0;
27 }
28