xref: /llvm-project/llvm/test/ExecutionEngine/OrcLazy/hidden-visibility.ll (revision 2d56d8c4e8751c7e2cab927cdeb4e519af3f3585)
1; RUN: lli -jit-kind=orc-lazy -extra-module %p/Inputs/hidden-definitions.ll %s
2; RUN: not lli -jit-kind=orc-lazy -jd libFoo -extra-module %p/Inputs/hidden-definitions.ll %s
3;
4; Check that hidden symbols in another module are visible when the module is
5; added to the same JITDylib, and not visible if it is added to a different
6; JITDylib.
7
8@bar = external global i32
9declare i32 @foo()
10
11define i32 @main(i32 %argc, ptr nocapture readnone %argv) {
12entry:
13  %0 = call i32() @foo()
14  %1 = load i32, ptr @bar
15  %2 = add i32 %0, %1
16  ret i32 %2
17}
18