llvm-project/llvm/test/ExecutionEngine/Orc/trivial-reference-to-global-variable.ll
Lang Hames 563ce9aa4a [lli] Add new testcases for lli.
These are an attempt to more systematically test the features covered by the
MCJIT regression tests (though these tests apply to lli's default mode, which
is now -jit-kind=orc).

This first batch of tests includes a basic smoke test (trivial-return-zero),
tests for single function calls and data references, and alignment handling.
2023-05-12 15:40:04 +10:00

17 lines
396 B
LLVM

; Check that we can execute a program that makes a single reference to an
; external linkage global variable that is initialized to a non-zero value.
;
; Failure may indicate a problem with data-section or GOT handling.
;
; RUN: %lli %s
@X = global i32 1
define i32 @main(i32 %argc, i8** %argv) {
entry:
%0 = load i32, i32* @X
%1 = icmp ne i32 %0, 1
%2 = zext i1 %1 to i32
ret i32 %2
}