llvm/bolt/test/R_ABS.pic.lld.cpp
Vladislav Khmelevsky 506a91c089 [BOLT] Move some of the tests to common directory
Some of the tests are not x86-specific, move them to common directory.

Differential Revision: https://reviews.llvm.org/D121261
2022-03-09 14:51:17 +03:00

16 lines
434 B
C++

/*
* Check that we don't assert on a duplicate static relocation added by lld
* against _Z6myfuncv. The same address has a dynamic relocation against it.
*
* RUN: %clang -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
* RUN: llvm-bolt %t.so -o %t.so.bolt -relocs
*/
unsigned long long myfunc();
unsigned long long (*myglobal)() = myfunc;
unsigned long long myfunc() {
return reinterpret_cast<unsigned long long>(myglobal);
}