dyld-625.13.tar.gz
[apple/dyld.git] / testing / test-cases / dlopen-in-init.dtest / main.c
1
2
3 // BUILD: $CC foo.c -dynamiclib -o $BUILD_DIR/libfoo.dylib -install_name $RUN_DIR/libfoo.dylib
4 // BUILD: $CC main.c -o $BUILD_DIR/dlopen-in-init.exe $BUILD_DIR/libfoo.dylib
5
6 // RUN: ./dlopen-in-init.exe
7
8 #include <stdio.h>
9 #include <dlfcn.h>
10 #include <stdlib.h>
11
12
13 __attribute__((constructor))
14 void myinit()
15 {
16
17 }
18
19
20 int main()
21 {
22 printf("[BEGIN] dlopen-in-init\n");
23
24 // The test is for libdyld.dylib to not crash when libfoo.dylib dlopen() stuff in its initializer
25
26 printf("[PASS] dlopen-in-init\n");
27 return 0;
28 }
29