]> git.saurik.com Git - apple/dyld.git/blob - testing/test-cases/dlopen-in-init.dtest/main.c
dyld-851.27.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 #include "test_support.h"
13
14 __attribute__((constructor))
15 void myinit()
16 {
17
18 }
19
20
21 int main(int argc, const char* argv[], const char* envp[], const char* apple[]) {
22 // The test is for libdyld.dylib to not crash when libfoo.dylib dlopen() stuff in its initializer
23 PASS("Success");
24 }
25