dyld-750.5.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 #include "test_support.h"
12
13 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
14 // We only support trying to save to containerised paths, so anything not
15 // of that form should fail
16 if ( !dyld_need_closure("./foo.exe", "/tmp/Containers/Data/") ) {
17 FAIL("Should have needed a closure for containerised path");
18 }
19
20 if ( dyld_need_closure("./foo.exe", "/tmp/Containers/Data2/") ) {
21 FAIL("Should have rejected a closure for non-containerised path");
22 }
23
24 PASS("Success");
25 }