xref: /llvm-project/llvm/test/ExecutionEngine/MCJIT/load-object-a.ll (revision c42c67ad60449fe19949f2664c2a5878b3f72b7e)
1; This first line will generate the .o files for the next run line
2; RUN: rm -rf %t.cachedir %t.cachedir2 %t.cachedir3
3; RUN: mkdir -p %t.cachedir %t.cachedir2 %t.cachedir3
4; RUN: %lli -jit-kind=mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -enable-cache-manager -object-cache-dir=%t.cachedir %s
5; RUN: %lli -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -enable-cache-manager -object-cache-dir=%t.cachedir %s
6
7; Collect generated objects.
8; RUN: find %t.cachedir -type f -name 'multi-module-?.o' -exec mv -v '{}' %t.cachedir2 ';'
9
10; This line tests MCJIT object loading
11; RUN: %lli -jit-kind=mcjit -extra-object=%t.cachedir2/multi-module-b.o -extra-object=%t.cachedir2/multi-module-c.o %s
12; RUN: %lli -extra-object=%t.cachedir2/multi-module-b.o -extra-object=%t.cachedir2/multi-module-c.o %s
13
14; These lines put the object files into an archive
15; RUN: llvm-ar r %t.cachedir3/load-object.a %t.cachedir2/multi-module-b.o
16; RUN: llvm-ar r %t.cachedir3/load-object.a %t.cachedir2/multi-module-c.o
17
18; This line test MCJIT archive loading
19; RUN: %lli -jit-kind=mcjit -extra-archive=%t.cachedir3/load-object.a %s
20; RUN: %lli -extra-archive=%t.cachedir3/load-object.a %s
21
22declare i32 @FB()
23
24define i32 @main() {
25  %r = call i32 @FB( )   ; <i32> [#uses=1]
26  ret i32 %r
27}
28