]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dyld_need_closure.dtest/main.c
dyld-732.8.tar.gz
[apple/dyld.git] / testing / test-cases / dyld_need_closure.dtest / main.c
1
2 // BUILD: $CC main.c -o $BUILD_DIR/foo.exe
3 // BUILD: $CC main.c -o $BUILD_DIR/dyld_need_closure.exe
4
5 // RUN: ./dyld_need_closure.exe
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <mach-o/dyld_priv.h>
10
11
12 int main()
13 {
14 printf("[BEGIN] dyld_need_closure\n");
15
16 // We only support trying to save to containerised paths, so anything not
17 // of that form should fail
18 if ( !dyld_need_closure("./foo.exe", "/tmp/Containers/Data/") ) {
19 printf("[FAIL] dyld_closure: Should have needed a closure for containerised path\n");
20 return 0;
21 }
22
23 if ( dyld_need_closure("./foo.exe", "/tmp/Containers/Data2/") ) {
24 printf("[FAIL] dyld_closure: Should have rejected a closure for non-containerised path\n");
25 return 0;
26 }
27
28 printf("[PASS] dyld_need_closure\n");
29
30 return 0;
31 }