xref: /llvm-project/llvm/test/ExecutionEngine/Orc/trivial-reference-to-global-variable.ll (revision 563ce9aa4ab22f10e0aa2799a3562a65a629ad0a)
1; Check that we can execute a program that makes a single reference to an
2; external linkage global variable that is initialized to a non-zero value.
3;
4; Failure may indicate a problem with data-section or GOT handling.
5;
6; RUN: %lli %s
7
8@X = global i32 1
9
10define i32 @main(i32 %argc, i8** %argv) {
11entry:
12  %0 = load i32, i32* @X
13  %1 = icmp ne i32 %0, 1
14  %2 = zext i1 %1 to i32
15  ret i32 %2
16}
17