]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_image_path_containing_address.dtest/main.c
2 // BUILD: $CC main.c -o $BUILD_DIR/dyld_image_path_containing_address-test.exe
4 // RUN: ./dyld_image_path_containing_address-test.exe
10 #include <mach-o/dyld.h>
11 #include <mach-o/dyld_priv.h>
16 printf("[BEGIN] dyld_image_path_containing_address-test\n");
18 int count
= _dyld_image_count();
19 for (int i
=0; i
< count
; ++i
) {
20 const struct mach_header
* mh
= _dyld_get_image_header(i
);
21 const char* name1
= _dyld_get_image_name(i
);
22 const char* name2
= dyld_image_path_containing_address(mh
);
23 if ( strcmp(name1
, name2
) != 0 ) {
24 printf("[FAIL] dyld_image_path_containing_address-test: %s != %s\n", name1
, name2
);
29 printf("[PASS] dyld_image_path_containing_address-test\n");