2021-09-29 06:47:51 +08:00
|
|
|
/*
|
|
|
|
* 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.
|
|
|
|
*
|
2022-07-12 08:58:32 +08:00
|
|
|
* This test uses the clang driver + lld and will only succeed on Linux systems
|
|
|
|
* with libc available.
|
|
|
|
* REQUIRES: system-linux
|
|
|
|
*
|
2022-05-13 22:12:40 +08:00
|
|
|
* RUN: %clang %cflags -fPIC -shared %s -o %t.so -Wl,-q -fuse-ld=lld
|
2022-06-11 05:10:58 +08:00
|
|
|
* RUN: llvm-bolt %t.so -o %t.so.bolt --relocs
|
2021-09-29 06:47:51 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
unsigned long long myfunc();
|
|
|
|
|
|
|
|
unsigned long long (*myglobal)() = myfunc;
|
|
|
|
|
|
|
|
unsigned long long myfunc() {
|
|
|
|
return reinterpret_cast<unsigned long long>(myglobal);
|
|
|
|
}
|