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