1; @f and @g are lazily linked. @f requires @g - ensure @g is correctly linked.
2
3; RUN: echo "declare i32 @f(i32)" > %t.1.ll
4; RUN: echo "define i32 @h(i32 %x) {" >> %t.1.ll
5; RUN: echo "  %1 = call i32 @f(i32 %x)" >> %t.1.ll
6; RUN: echo "  ret i32 %1" >> %t.1.ll
7; RUN: echo "}" >> %t.1.ll
8; RUN: llvm-as < %t.1.ll > %t.1.bc
9; RUN: llvm-as < %s > %t.2.bc
10; RUN: llvm-link %t.1.bc %t.2.bc
11
12define available_externally i32 @f(i32 %x) {
13  %1 = call i32 @g(i32 %x)
14  ret i32 %1
15}
16
17define available_externally i32 @g(i32 %x) {
18  ret i32 5
19}
20
21