mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
1c8e58ce82
The PowerPC part of processRelocationRef currently assumes that external symbols can be identified by checking for SymType == SymbolRef::ST_Unknown. This is actually incorrect in some cases, causing relocation overflows to be mis-detected. The correct check is to test whether Value.SymbolName is null. Includes test case. Note that it is a bit tricky to replicate the exact condition that triggers the bug in a test case. The one included here seems to fail reliably (before the fix) across different operating system versions on Power, but it still makes a few assumptions (called out in the test case comments). Also add ppc64le platform name to the supported list in the lit.local.cfg files for the MCJIT and OrcMCJIT directories, since those tests were currently not run at all. Fixes PR32650. Reviewer: hfinkel Differential Revision: https://reviews.llvm.org/D33402 llvm-svn: 303637
29 lines
771 B
LLVM
29 lines
771 B
LLVM
; RUN: %lli -jit-kind=orc-mcjit %s
|
|
|
|
; This test is intended to verify that a function weakly defined in
|
|
; JITted code, and strongly defined in the main executable, can be
|
|
; correctly resolved when called from elsewhere in JITted code.
|
|
|
|
; This test makes the assumption that the lli executable in compiled
|
|
; to export symbols (e.g. --export-dynamic), and that is actually does
|
|
; contain the symbol LLVMInitializeCodeGen. (Note that this function
|
|
; is not actually called by the test. The test simply verifes that
|
|
; the reference can be resolved without relocation errors.)
|
|
|
|
define linkonce_odr void @LLVMInitializeCodeGen() {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define void @test() {
|
|
entry:
|
|
call void @LLVMInitializeCodeGen()
|
|
ret void
|
|
}
|
|
|
|
define i32 @main() {
|
|
entry:
|
|
ret i32 0
|
|
}
|
|
|