]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-empty-data.dtest/main.c
2 // BUILD: $CC foo.c -dynamiclib -install_name $RUN_DIR/libfoo-static.dylib -o $BUILD_DIR/libfoo-static.dylib
3 // BUILD: $CC foo.c -dynamiclib -install_name $RUN_DIR/libfoo-dynamic.dylib -o $BUILD_DIR/libfoo-dynamic.dylib
4 // BUILD: $CC main.c $BUILD_DIR/libfoo-static.dylib -o $BUILD_DIR/dlopen-empty-data.exe -DRUN_DIR="$RUN_DIR"
7 // RUN: ./dlopen-empty-data.exe
12 #include "test_support.h"
14 // libfoo-static.dylib and libfoo-dynamic.dylib each have an empty (no disk size) DATA segment
16 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
17 void* handle
= dlopen(RUN_DIR
"/libfoo-dynamic.dylib", RTLD_LAZY
);
18 if ( handle
== NULL
) {
19 FAIL("libfoo-dynamic.dylib could not be loaded: %s", dlerror());