]>
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 $RUN_DIR/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 $BUILD_DIR/libfoo2.dylib -install_name $RUN_DIR/libfoomissing.dylib
4 // BUILD: $CC missing.c $BUILD_DIR/libfoo2.dylib -o $BUILD_DIR/dylib-static-weak-missing.exe
6 // BUILD: $SKIP_INSTALL $BUILD_DIR/libfoo2.dylib
8 // RUN: ./dylib-static-weak-present.exe
9 // RUN: ./dylib-static-weak-missing.exe
15 #include "test_support.h"
17 extern int foo
__attribute__((weak_import
));
20 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
21 // dylib will be found at runtime, so &foo should never be NULL