dyld-750.6.tar.gz
[apple/dyld.git] / testing / test-cases / no-shared-cache.dtest / main.c
1 // BUILD_ONLY: MacOSX
2
3 // BUILD: $CC main.c -framework AppKit -o $BUILD_DIR/no_shared_cache.exe
4
5 // RUN: DYLD_SHARED_REGION=avoid ./no_shared_cache.exe
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <string.h>
10 #include <mach-o/dyld_priv.h>
11 #include <dlfcn.h>
12
13 #include "test_support.h"
14
15 // This program links with AppKit which in dyld3 mode stress tests building closures when there is no dyld shared cache
16
17 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
18
19 size_t cacheLen;
20 const void* cacheStart = _dyld_get_shared_cache_range(&cacheLen);
21
22 if ( cacheStart != NULL ) {
23 FAIL("_dyld_get_shared_cache_range() returned %p even though we are not using a dyld cache", cacheStart);
24 }
25
26 PASS("Success");
27 }
28