]> git.saurik.com Git - apple/dyld.git/blob - unit-tests/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH/main.c
dyld-750.5.tar.gz
[apple/dyld.git] / unit-tests / test-cases / env-DYLD_FALLBACK_LIBRARY_PATH / main.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <dlfcn.h>
5
6 #include "test.h"
7
8 extern void compress();
9
10 int main(int argc, const char* argv[])
11 {
12 #if !SHOULD_FAIL
13 Dl_info info;
14 if ( dladdr(&compress, &info) ) {
15 //fprintf(stderr, "_compress found in %s\n", info.dli_fname);
16 if ( strstr(info.dli_fname, argv[1]) != 0 ) {
17 PASS("env-DYLD_FALLBACK_LIBRARY_PATH");
18 exit(0);
19 }
20 }
21 FAIL("env-DYLD_FALLBACK_LIBRARY_PATH");
22 #endif
23 return EXIT_SUCCESS;
24 }