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