2013-05-07 00:17:29 +08:00
|
|
|
; Test the stackrestore builtin.
|
|
|
|
;
|
|
|
|
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
|
|
|
|
|
2014-01-13 23:44:44 +08:00
|
|
|
declare i8 *@llvm.stacksave()
|
2013-05-07 00:17:29 +08:00
|
|
|
declare void @llvm.stackrestore(i8 *)
|
|
|
|
|
|
|
|
; we should use a frame pointer and tear down the frame based on %r11
|
|
|
|
; rather than %r15.
|
2014-01-13 23:44:44 +08:00
|
|
|
define void @f1(i32 %count1, i32 %count2) {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: f1:
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: stmg %r11, %r15, 88(%r15)
|
2014-01-13 23:44:44 +08:00
|
|
|
; CHECK: aghi %r15, -160
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: lgr %r11, %r15
|
2014-01-13 23:44:44 +08:00
|
|
|
; CHECK: lgr %r15, %r{{[0-5]}}
|
|
|
|
; CHECK: lmg %r11, %r15, 248(%r11)
|
2013-05-07 00:17:29 +08:00
|
|
|
; CHECK: br %r14
|
2014-01-13 23:44:44 +08:00
|
|
|
%src = call i8 *@llvm.stacksave()
|
|
|
|
%array1 = alloca i8, i32 %count1
|
|
|
|
store volatile i8 0, i8 *%array1
|
2013-05-07 00:17:29 +08:00
|
|
|
call void @llvm.stackrestore(i8 *%src)
|
2014-01-13 23:44:44 +08:00
|
|
|
%array2 = alloca i8, i32 %count2
|
|
|
|
store volatile i8 0, i8 *%array2
|
2013-05-07 00:17:29 +08:00
|
|
|
ret void
|
|
|
|
}
|