xref: /llvm-project/llvm/test/CodeGen/SystemZ/frame-11.ll (revision a1710eb3cd5823c5d14899112ca3086acbdbe9cb)
1; Test the stackrestore builtin.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5declare ptr@llvm.stacksave()
6declare void @llvm.stackrestore(ptr)
7
8; we should use a frame pointer and tear down the frame based on %r11
9; rather than %r15.
10define void @f1(i32 %count1, i32 %count2) {
11; CHECK-LABEL: f1:
12; CHECK: stmg %r11, %r15, 88(%r15)
13; CHECK: aghi %r15, -160
14; CHECK: lgr %r11, %r15
15; CHECK: lgr %r15, %r{{[0-5]}}
16; CHECK: lmg %r11, %r15, 248(%r11)
17; CHECK: br %r14
18  %src = call ptr@llvm.stacksave()
19  %array1 = alloca i8, i32 %count1
20  store volatile i8 0, ptr %array1
21  call void @llvm.stackrestore(ptr %src)
22  %array2 = alloca i8, i32 %count2
23  store volatile i8 0, ptr %array2
24  ret void
25}
26