1 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
3 ; The current function's frame address is the address of
4 ; the optional back chain slot.
5 define ptr @fp0() nounwind {
8 ; CHECK: la %r2, 0(%r15)
10 %0 = tail call ptr @llvm.frameaddress(i32 0)
14 ; Check that the frame address is correct in a presence
16 define ptr @fp0f() nounwind {
19 ; CHECK: aghi %r15, -168
20 ; CHECK: la %r2, 168(%r15)
21 ; CHECK: aghi %r15, 168
23 %0 = alloca i64, align 8
24 %1 = tail call ptr @llvm.frameaddress(i32 0)
28 ; Check the caller's frame address.
29 define ptr @fpcaller() nounwind "backchain" {
31 ; CHECK-LABEL: fpcaller:
32 ; CHECK: lg %r2, 0(%r15)
34 %0 = tail call ptr @llvm.frameaddress(i32 1)
38 ; Check the caller's frame address.
39 define ptr @fpcallercaller() nounwind "backchain" {
41 ; CHECK-LABEL: fpcallercaller:
42 ; CHECK: lg %r1, 0(%r15)
43 ; CHECK: lg %r2, 0(%r1)
45 %0 = tail call ptr @llvm.frameaddress(i32 2)
49 declare ptr @llvm.frameaddress(i32) nounwind readnone