]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlsym-in-interposed-malloc.dtest/main.c
dyld-732.8.tar.gz
[apple/dyld.git] / testing / test-cases / dlsym-in-interposed-malloc.dtest / main.c
1 // BUILD: $CC main.c -o $BUILD_DIR/dlsym-in-interposed-malloc.exe
2 // BUILD: $DYLD_ENV_VARS_ENABLE $BUILD_DIR/dlsym-in-interposed-malloc.exe
3 // BUILD: $CC interposer.c -dynamiclib -o $BUILD_DIR/libmyalloc.dylib -install_name libmyalloc.dylib
4
5 // RUN: DYLD_INSERT_LIBRARIES=libmyalloc.dylib ./dlsym-in-interposed-malloc.exe
6
7
8 #include <stdio.h>
9 #include <stdlib.h>
10 #include <string.h>
11
12 int main()
13 {
14 printf("[BEGIN] dlsym-in-interposed-malloc\n");
15
16 // malloc should have been called when dyld3's libdyld was initialized, but
17 // call it one more time anyway just to make sure its working
18 (void)malloc(1);
19
20
21 //printf("%p %p %p %p\n", p1, p2, p3, p4);
22 printf("[PASS] dlsym-in-interposed-malloc\n");
23 return 0;
24 }