3 // BUILD: $CC zzz.c -dynamiclib -o $BUILD_DIR/libzzz.dylib -install_name $RUN_DIR/libzzz.dylib
4 // BUILD: $CC main.c -o $BUILD_DIR/NSAddImage-basic.exe -Wno-deprecated-declarations
6 // RUN: ./NSAddImage-basic.exe $RUN_DIR/libzzz.dylib
7 // RUN: ./NSAddImage-basic.exe libzzz.dylib
12 #include <mach-o/dyld.h>
14 #include "test_support.h"
16 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
17 const char* path
= argv
[1];
19 const struct mach_header
* mh
= NSAddImage(path
, NSADDIMAGE_OPTION_WITH_SEARCHING
);
21 FAIL("Could not load \"%s\"", path
);