dyld-750.5.tar.gz
[apple/dyld.git] / testing / test-cases / cwd-relative-load.dtest / main.c
1
2
3 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name libfoo.dylib
4 // BUILD: $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/cwd-load.exe
5 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/cwd-load.exe
6
7 // RUN: ./cwd-load.exe
8
9 // libfoo.dylib is loaded from the current directory (not an absolute path)
10
11
12 #include <stdio.h>
13
14 #include "test_support.h"
15
16 extern int foo;
17
18
19 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
20 if ( foo == 42 )
21 PASS("cwd-relative-load");
22 else
23 FAIL("cwd-relative-load, wrong value");
24 }
25
26