]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/env-DYLD_FALLBACK_LIBRARY_PATH.dtest/main.c
dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / env-DYLD_FALLBACK_LIBRARY_PATH.dtest / main.c
1
2 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib -DVALUE=1
3 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/fallback/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib -DVALUE=42
4 // BUILD: $CC main.c -o $BUILD_DIR/env-DYLD_FALLBACK_LIBRARY_PATH.exe $BUILD_DIR/libfoo.dylib
5 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/env-DYLD_FALLBACK_LIBRARY_PATH.exe
6
7 // BUILD: $SKIP_INSTALL $BUILD_DIR/libfoo.dylib
8
9 // RUN: DYLD_FALLBACK_LIBRARY_PATH=$RUN_DIR/fallback/ ./env-DYLD_FALLBACK_LIBRARY_PATH.exe
10
11 #include <stdio.h>
12
13 #include "test_support.h"
14
15 extern int foo();
16
17 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
18 if ( foo() == 42 )
19 PASS("Success");
20 else
21 FAIL("libfoo.dylib incorrectly used fallback");
22 }
23