]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/interpose-resolver.dtest/main.c
2 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib
3 // BUILD: $CC interposer.c -dynamiclib -o $BUILD_DIR/libmyinterpose.dylib -install_name $RUN_DIR/libmyinterpose.dylib $BUILD_DIR/libfoo.dylib
4 // BUILD: $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/resolver-only.exe
5 // BUILD: $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/interposed-resolver.exe -DINTERPOSED $BUILD_DIR/libmyinterpose.dylib
7 // RUN: ./resolver-only.exe
8 // RUN: ./interposed-resolver.exe
20 printf("[BEGIN] interpose-resolver\n");
22 printf("[FAIL] interpose-resolver: foo() != 11\n");
23 else if ( (*pFoo
)() != 11 )
24 printf("[FAIL] interpose-resolver: *pFoo() != 11\n");
26 printf("[PASS] interpose-resolver\n");
28 printf("[BEGIN] resolver-only\n");
30 printf("[FAIL] resolver-only: foo() != 10\n");
31 else if ( (*pFoo
)() != 10 )
32 printf("[FAIL] resolver-only: *pFoo() != 10\n");
34 printf("[PASS] resolver-only\n");