summaryrefslogtreecommitdiff
path: root/libphobos/testsuite/libphobos.shared/load_mod_collision.d
blob: 64243d4b7bb2fc036a9535edfef9f4e160354dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module lib; // module collides with lib.so

import core.runtime;
import core.stdc.stdio;
import core.stdc.string;
import core.sys.posix.dlfcn;

void main(string[] args)
{
    auto name = args[0] ~ '\0';
    const pathlen = strrchr(name.ptr, '/') - name.ptr + 1;
    name = name[0 .. pathlen] ~ "lib.so";
    auto lib = Runtime.loadLibrary(name);
}