483725f83a47831f05a3a60a43c29e89c26be790
[apple/dyld.git] / testing / test-cases / dlopen-prebuilt-dlopen-closure.dtest / main.c
1
2 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-prebuilt-dlopen-closure.exe
3
4 // RUN: ./dlopen-prebuilt-dlopen-closure.exe
5
6 // /usr/lib/libobjc-trampolines.dylib is not in the shared cache, but gets a prebuilt
7 // closure. On embedded platforms, this is validated using the cd-hash of the file vs
8 // what is in the pre-built closure.
9
10 #include <stdio.h>
11 #include <dlfcn.h>
12
13 int main()
14 {
15 printf("[BEGIN] dlopen-prebuilt-dlopen-closure\n");
16
17 void* handle = dlopen("/usr/lib/libobjc-trampolines.dylib", RTLD_LAZY);
18 if ( handle == NULL ) {
19 printf("dlerror(): %s\n", dlerror());
20 printf("[FAIL] dlopen-prebuilt-dlopen-closure\n");
21 return 0;
22 }
23
24 printf("[PASS] dlopen-prebuilt-dlopen-closure\n");
25
26 return 0;
27 }
28