llvm-project/bolt/test/R_ABS.pic.lld.cpp
Rafael Auler 42a66fb727 [BOLT] Restrict execution of tests that fail on Windows
Turn off execution of tests that use UNIX-specific features.

Reviewed By: Amir

Differential Revision: https://reviews.llvm.org/D126933
2022-07-11 17:59:58 -07:00

20 lines
576 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.
*
* This test uses the clang driver + lld and will only succeed on Linux systems
* with libc available.
* REQUIRES: system-linux
*
* RUN: %clang %cflags -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);
}