]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dylib-static-weak-link.dtest/present.c
1 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name libfoo.dylib
2 // BUILD: $CC present.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/dylib-static-weak-present.exe
3 // BUILD: $CC foo.c -dynamiclib -o $TEMP_DIR/libfoo2.dylib -install_name libfoomissing.dylib
4 // BUILD: $CC missing.c $TEMP_DIR/libfoo2.dylib -o $BUILD_DIR/dylib-static-weak-missing.exe
6 // RUN: ./dylib-static-weak-present.exe
7 // RUN: ./dylib-static-weak-missing.exe
13 extern int foo
__attribute__((weak_import
));
18 printf("[BEGIN] dylib-static-weak-link present\n");
19 // dylib will be found at runtime, so &foo should never be NULL
22 printf("[PASS] dylib-static-weak-link present\n");
24 printf("[FAIL] dylib-static-weak-link present, wrong value\n");
27 printf("[FAIL] dylib-static-weak-link present, &foo == NULL\n");