]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/env-DYLD_LIBRARY_PATH.dtest/main.c
2 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/door1/libfoo.dylib -install_name $RUN_DIR/door1/libfoo.dylib -DVALUE=1
3 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/door2/libfoo.dylib -install_name $RUN_DIR/door2/libfoo.dylib -DVALUE=42
4 // BUILD: $CC main.c -o $BUILD_DIR/env-DYLD_LIBRARY_PATH.exe $BUILD_DIR/door1/libfoo.dylib
5 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/env-DYLD_LIBRARY_PATH.exe
7 // RUN: ./env-DYLD_LIBRARY_PATH.exe
8 // RUN: DYLD_LIBRARY_PATH=$RUN_DIR/door2/ ./env-DYLD_LIBRARY_PATH.exe
13 #include "test_support.h"
17 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
18 int expected
= (getenv("DYLD_LIBRARY_PATH") != NULL
) ? 42 : 1;
20 if ( foo() == expected
)
23 FAIL("Wrong dylib loaded");