xref: /llvm-project/llvm/test/ExecutionEngine/OrcLazy/emulated-tls.ll (revision 231107a8b5be77d1c76975b0363976ba3211fa37)
1; LoongArch does not support emulated tls.
2; UNSUPPORTED: target=loongarch{{.*}}
3
4; RUN: not lli -no-process-syms -lljit-platform=Inactive -emulated-tls \
5; RUN:   -jit-kind=orc-lazy %s 2>&1 | FileCheck %s
6;
7; Test that emulated-tls does not generate any unexpected errors.
8;
9; Unfortunately we cannot test successful execution of JIT'd code with
10; emulated-tls as this would require the JIT itself, in this case lli, to be
11; built with emulated-tls, which is not a common configuration. Instead we test
12; that the only error produced by the JIT for a thread-local with emulated-tls
13; enabled is a missing symbol error for __emutls_get_address. An unresolved
14; reference to this symbol (and only this symbol) implies (1) that the emulated
15; tls lowering was applied, and (2) that thread locals defined in the JIT'd code
16; were otherwise handled correctly.
17
18; CHECK: JIT session error: Symbols not found: [ {{[^,]*}}__emutls_get_address ]
19
20@x = thread_local global i32 42, align 4
21
22define i32 @main(i32 %argc, ptr %argv) {
23entry:
24  %0 = load i32, ptr @x, align 4
25  ret i32 %0
26}
27