]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/weak-def-unload.dtest/main.c
3 // BUILD: $CC bar.c -dynamiclib -install_name $RUN_DIR/libmissing.dylib -o $BUILD_DIR/libbar.dylib
4 // BUILD: $CC foo.c -dynamiclib $BUILD_DIR/libbar.dylib -install_name $RUN_DIR/libfoo.dylib -o $BUILD_DIR/libfoo.dylib
5 // BUILD: $CC main.c -o $BUILD_DIR/MATLAB -DRUN_DIR="$RUN_DIR"
9 // libfoo.dylib was weak-def exported symbols. This tests that it can fail to load cleanly.
14 #include "test_support.h"
18 int main(int argc
, const char* argv
[])
20 // force weak-def table to be generated
21 void* handle
= dlopen("/usr/lib/libc++.dylib", 0);
22 if ( handle
== NULL
) {
23 FAIL("weak-def-unload, expected dlopen(libc++.dylib) to succeed");
26 // try to dlopen something with weak symbols that fails to load
27 handle
= dlopen(RUN_DIR
"/libfoo.dylib", 0);
28 if ( handle
!= NULL
) {
29 FAIL("weak-def-unload, expected dlopen to fail");
32 PASS("weak-def-unload");