]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_has_inserted_or_interposing_libraries.dtest/main.c
2 // BUILD: $CC main.c -DRUN_DIR=$RUN_DIR -o $BUILD_DIR/insert_target.exe
3 // BUILD: $CC foo.c -dynamiclib -install_name $RUN_DIR/libfoo.dylib -o $BUILD_DIR/libfoo.dylib
4 // BUILD: $CC interposer.c -dynamiclib $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libinterposer.dylib -o $BUILD_DIR/libinterposer.dylib
5 // BUILD: $CC main.c $BUILD_DIR/libinterposer.dylib $BUILD_DIR/libfoo.dylib -DRUN_DIR=$RUN_DIR -o $BUILD_DIR/interpose_target.exe
6 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/insert_target.exe
8 // RUN: ./insert_target.exe
9 // RUN: DYLD_INSERT_LIBRARIES=$RUN_DIR/libfoo.dylib ./insert_target.exe true
10 // RUN: ./interpose_target.exe true
16 #include <mach-o/dyld_priv.h>
18 #include "test_support.h"
20 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
21 bool actual
= dyld_has_inserted_or_interposing_libraries();
22 bool expected
= (argc
== 2) && (strcmp(argv
[1], "true") == 0);
24 if (actual
!= expected
) {
25 FAIL("dyld_has_inserted_or_interposing_libraries");