]>
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>
13 #include "test_support.h"
15 int main(int argc
, const char* argv
[], const char* envp
[], const char* apple
[]) {
16 int count
= _dyld_image_count();
17 for (int i
=0; i
< count
; ++i
) {
18 const struct mach_header
* mh
= _dyld_get_image_header(i
);
19 const char* name1
= _dyld_get_image_name(i
);
20 const char* name2
= dyld_image_path_containing_address(mh
);
21 if ( strcmp(name1
, name2
) != 0 ) {
22 FAIL("%s != %s", name1
, name2
);