Add missing dir to create_testsuite_files script
[official-gcc.git] / libphobos / testsuite / libphobos.shared / load_linkdep.d
blob5f5dcf220cfeb451208968426f4d48c28fd2d7a1
1 import core.runtime;
2 import core.stdc.string;
3 import core.sys.posix.dlfcn;
5 extern(C) alias RunDepTests = int function();
7 void main(string[] args)
9 auto name = args[0] ~ '\0';
10 const pathlen = strrchr(name.ptr, '/') - name.ptr + 1;
11 name = name[0 .. pathlen] ~ "liblinkdep.so";
13 auto h = Runtime.loadLibrary(name);
14 assert(h);
15 auto runDepTests = cast(RunDepTests)dlsym(h, "runDepTests");
16 assert(runDepTests());
17 assert(Runtime.unloadLibrary(h));