mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-20 02:28:23 +00:00
5ba1094838
Extend LinkModules to pass a ValueMaterializer to RemapInstruction and friends to lazily create Functions for lazily linked globals. This is a big win when linking small modules with large (mostly unused) library modules. llvm-svn: 182776
16 lines
414 B
LLVM
16 lines
414 B
LLVM
; @f and @g are lazily linked. @f requires @g - ensure @g is correctly linked.
|
|
|
|
; RUN: echo -e "declare i32 @f(i32)\ndefine i32 @h(i32 %x) {\n%1 = call i32 @f(i32 %x)\nret i32 %1\n}" | llvm-as >%t.1.bc
|
|
; RUN: llvm-as < %s > %t.2.bc
|
|
; RUN: llvm-link %t.1.bc %t.2.bc
|
|
|
|
define available_externally i32 @f(i32 %x) {
|
|
%1 = call i32 @g(i32 %x)
|
|
ret i32 %1
|
|
}
|
|
|
|
define available_externally i32 @g(i32 %x) {
|
|
ret i32 5
|
|
}
|
|
|