1; Test that a huge address offset is loaded into a register and then added
2; separately.
3;
4; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5
6@a = common dso_local global i32 0, align 4
7
8define i64 @f1() {
9; CHECK-LABEL: f1:
10; CHECK: llihl   %r0, 829
11; CHECK: oilf    %r0, 4294966308
12; CHECK: larl    %r2, a
13; CHECK: agr     %r2, %r0
14; CHECK: br      %r14
15  ret i64 add (i64 ptrtoint (i32* @a to i64), i64 3564822854692)
16}
17
18define signext i32 @f2() {
19; CHECK-LABEL: f2:
20; CHECK: llihl   %r0, 829
21; CHECK: oilf    %r0, 4294966308
22; CHECK: larl    %r1, a
23; CHECK: agr     %r1, %r0
24; CHECK: lgf     %r2, 0(%r1)
25; CHECK: br      %r14
26entry:
27  %0 = load i32, i32* inttoptr (i64 add (i64 ptrtoint (i32* @a to i64),
28                                i64 3564822854692) to i32*)
29  ret i32 %0
30}
31
32