1 ; Test loads of symbolic addresses when generating small-model non-PIC.
2 ; All addresses can be treated as PC
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
6 @e4 = external dso_local global i32
7 @d4 = dso_local global i32 1
8 @e2 = external dso_local global i32, align 2
9 @d2 = dso_local global i32 1, align 2
10 @e1 = external dso_local global i32, align 1
11 @d1 = dso_local global i32 1, align 1
13 declare dso_local void @ef()
14 define dso_local void @df() {
18 declare dso_local void @foo(ptr)
20 ; Test a load of a fully-aligned external variable.
21 define dso_local ptr@f1() {
28 ; Test a load of a fully-aligned local variable.
29 define dso_local ptr@f2() {
36 ; Test a load of a 2-byte-aligned external variable.
37 define dso_local ptr@f3() {
44 ; Test a load of a 2-byte-aligned local variable.
45 define dso_local ptr@f4() {
52 ; Test a load of an unaligned external variable, which must go via the GOT.
53 define dso_local ptr@f5() {
55 ; CHECK: lgrl %r2, e1@GOT
60 ; Test a load of an unaligned local variable, which must go via the GOT.
61 define dso_local ptr@f6() {
63 ; CHECK: lgrl %r2, d1@GOT
68 ; Test a load of an external function.
69 define dso_local ptr@f7() {
76 ; Test a load of a local function.
77 define dso_local ptr@f8() {
84 ; Test that LARL can be rematerialized.
85 define dso_local i32 @f9() {
88 ; CHECK: brasl %r14, foo@PLT
90 ; CHECK: brasl %r14, foo@PLT
92 call void @foo(ptr@d2)
93 call void @foo(ptr@d2)