1 ; Test the stackrestore builtin.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 declare ptr@llvm.stacksave()
6 declare void @llvm.stackrestore(ptr)
8 ; we should use a frame pointer and tear down the frame based on %r11
10 define void @f1(i32 %count1, i32 %count2) {
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)
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