]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlsym-in-interposed-malloc.dtest/main.c
dyld-832.7.1.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 #include "test_support.h"
13
14 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
15 // malloc should have been called when dyld3's libdyld was initialized, but
16 // call it one more time anyway just to make sure its working
17 (void)malloc(1);
18
19 PASS("Success");
20 }