]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH.dtest/main.c
dyld-519.2.1.tar.gz
[apple/dyld.git] / testing / test-cases / env-DYLD_FALLBACK_LIBRARY_PATH.dtest / main.c
1
2 // BUILD: mkdir -p $BUILD_DIR/fallback
3 // BUILD: $CC foo.c -dynamiclib -o $TEMP_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib -DVALUE=1
4 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/fallback/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib -DVALUE=42
5 // BUILD: $CC main.c -o $BUILD_DIR/main.exe $TEMP_DIR/libfoo.dylib
6 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/main.exe
7
8 // RUN: DYLD_FALLBACK_LIBRARY_PATH=$RUN_DIR/fallback/ ./main.exe
9
10 #include <stdio.h>
11
12 extern int foo();
13
14 int main()
15 {
16 printf("[BEGIN] env-DYLD_FALLBACK_LIBRARY_PATH\n");
17
18 if ( foo() == 42 )
19 printf("[PASS] env-DYLD_FALLBACK_LIBRARY_PATH\n");
20 else
21 printf("[FAIL] env-DYLD_FALLBACK_LIBRARY_PATH\n");
22
23 return 0;
24 }
25