transitive-lazy-link.ll 537 B

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