1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/ExecutionEngine/MCJIT/weak-function.ll
Stefan Gränitz b608c4e35f Re-apply "[lli] Make -jit-kind=orc the default JIT engine"
MCJIT served well as the default JIT engine in lli for a long time, but the code is getting old and maintenance efforts don't seem to be in sight. In the meantime Orc became mature enough to fill that gap. The newly added greddy mode is very similar to the execution model of MCJIT. It should work as a drop-in replacement for common JIT tasks.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D98931
2021-03-30 12:08:26 +02:00

31 lines
676 B
LLVM

; RUN: lli -jit-kind=mcjit -extra-module %p/Inputs/weak-function-2.ll %s
; RUN: lli -extra-module %p/Inputs/weak-function-2.ll %s
; UNSUPPORTED: uses_COFF
;
; Check that functions in two different modules agree on the address of weak
; function 'baz'
; Testing on COFF platforms is disabled as COFF has no representation of 'weak'
; linkage.
define weak i32 @baz() {
entry:
ret i32 0
}
define i8* @foo() {
entry:
ret i8* bitcast (i32 ()* @baz to i8*)
}
declare i8* @bar()
define i32 @main(i32 %argc, i8** %argv) {
entry:
%call = tail call i8* @foo()
%call1 = tail call i8* @bar()
%cmp = icmp ne i8* %call, %call1
%conv = zext i1 %cmp to i32
ret i32 %conv
}