1; RUN: llc -O0 < %s -march=avr | FileCheck %s
2
3; CHECK-LABEL: foo
4define void @foo() {
5entry:
6  br label %save
7
8; CHECK-LABEL: save
9; CHECK: in [[SREG1:r[0-9]+]], 61
10; CHECK-NEXT: in [[SREG2:r[0-9]+]], 62
11save:
12  %saved = call i8* @llvm.stacksave()
13  br label %restore
14
15; CHECK-LABEL: restore
16; CHECK: in r0, 63
17; CHECK-NEXT: cli
18; CHECK-NEXT: out 62, [[SREG2]]
19; CHECK-NEXT: out 63, r0
20; CHECK-NEXT: out 61, [[SREG1]]
21restore:
22  call void @llvm.stackrestore(i8* %saved)
23  ret void
24}
25
26declare i8* @llvm.stacksave()
27declare void @llvm.stackrestore(i8* %ptr)
28