20 lines · cpp
1/*2 * Check that we don't assert on a duplicate static relocation added by lld3 * against _Z6myfuncv. The same address has a dynamic relocation against it.4 *5 * This test uses the clang driver + lld and will only succeed on Linux systems6 * with libc available.7 * REQUIRES: system-linux8 *9 * RUN: %clangxx %cxxflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld10 * RUN: llvm-bolt %t.so -o %t.so.bolt --relocs11 */12 13unsigned long long myfunc();14 15unsigned long long (*myglobal)() = myfunc;16 17unsigned long long myfunc() {18 return reinterpret_cast<unsigned long long>(myglobal);19}20