]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dylib-static-link.dtest/present.c
dyld-733.6.tar.gz
[apple/dyld.git] / testing / test-cases / dylib-static-link.dtest / present.c
1
2
3 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib
4 // BUILD: $CC present.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/dylib-static-present.exe
5 // BUILD: $CC foo.c -dynamiclib -o $TEMP_DIR/libfoo2.dylib -install_name $RUN_DIR/libfoomissing.dylib
6 // BUILD: $CC missing.c $TEMP_DIR/libfoo2.dylib -o $BUILD_DIR/dylib-static-missing.exe
7
8 // RUN: ./dylib-static-present.exe
9 // RUN: NOCR_TEST_NAME="dylib-static-link missing" $REQUIRE_CRASH ./dylib-static-missing.exe
10
11
12 #include <stdio.h>
13
14 extern int foo;
15
16
17 int main()
18 {
19 printf("[BEGIN] dylib-static-link present\n");
20 if ( foo == 42 )
21 printf("[PASS] dylib-static-link present\n");
22 else
23 printf("[FAIL] dylib-static-link present, wrong value\n");
24
25 return 0;
26 }
27
28