1 ; Test the "S" asm constraint, which accepts addresses that have a base
2 ; and a 20-bit displacement.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -no-integrated-as | FileCheck %s
6 ; Check the lowest range.
7 define void @f1(i64 %base) {
9 ; CHECK: blah -524288(%r2)
11 %add = add i64 %base, -524288
12 %addr = inttoptr i64 %add to i64 *
13 call void asm "blah $0", "=*S" (i64 *%addr)
17 ; Check the next lowest byte.
18 define void @f2(i64 %base) {
20 ; CHECK: agfi %r2, -524289
23 %add = add i64 %base, -524289
24 %addr = inttoptr i64 %add to i64 *
25 call void asm "blah $0", "=*S" (i64 *%addr)
29 ; Check the highest range.
30 define void @f3(i64 %base) {
32 ; CHECK: blah 524287(%r2)
34 %add = add i64 %base, 524287
35 %addr = inttoptr i64 %add to i64 *
36 call void asm "blah $0", "=*S" (i64 *%addr)
40 ; Check the next highest byte.
41 define void @f4(i64 %base) {
43 ; CHECK: agfi %r2, 524288
46 %add = add i64 %base, 524288
47 %addr = inttoptr i64 %add to i64 *
48 call void asm "blah $0", "=*S" (i64 *%addr)