]>
git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/flat-namespace.dtest/main.c
3 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib
4 // BUILD: $CC main.c $BUILD_DIR/libfoo.dylib -o $BUILD_DIR/flat-namespace.exe -flat_namespace
6 // RUN: ./flat-namespace.exe
16 printf("[BEGIN] flat-namespace\n");
18 // check that the malloc in libfoo.dylib was used by looking at the content the allocated buffer
19 // <rdar://problem/31921090> strncmp is tricky for flat namespace because it is re-exporte and renamed
20 char* p1
= malloc(10);
21 if ( strncmp(p1
, "##########", 10) != 0 ) {
22 printf("[FAIL] malloc() from main executable not interposed\n");
26 printf("[PASS] flat-namespace\n");