1 ; RUN: llc < %s -march=xcore | FileCheck %s
3 define void @_Z1fz(...) {
7 ; CHECK: stw r[[REG:[0-3]{1,1}]]
9 ; CHECK: stw r[[REG:[0-3]{1,1}]]
10 ; CHECK: , sp[[[REG]]]
11 ; CHECK: stw r[[REG:[0-3]{1,1}]]
12 ; CHECK: , sp[[[REG]]]
13 ; CHECK: stw r[[REG:[0-3]{1,1}]]
14 ; CHECK: , sp[[[REG]]]
15 ; CHECK: ldaw sp, sp[3]
21 declare void @llvm.va_start(ptr) nounwind
22 declare void @llvm.va_end(ptr) nounwind
23 declare void @f(i32) nounwind
24 define void @test_vararg(...) nounwind {
26 ; CHECK-LABEL: test_vararg
28 ; CHECK: stw lr, sp[1]
29 ; CHECK-DAG: stw r3, sp[6]
30 ; CHECK-DAG: stw r0, sp[3]
31 ; CHECK-DAG: stw r1, sp[4]
32 ; CHECK-DAG: stw r2, sp[5]
33 ; CHECK: ldaw r0, sp[3]
34 ; CHECK: stw r0, sp[2]
35 %list = alloca ptr, align 4
36 call void @llvm.va_start(ptr %list)
39 ; CHECK-LABEL: .LBB1_1
40 ; CHECK: ldw r0, sp[2]
41 ; CHECK: add r1, r0, 4
42 ; CHECK: stw r1, sp[2]
43 ; CHECK: ldw r0, r0[0]
47 %0 = va_arg ptr %list, i32
51 call void @llvm.va_end(ptr %list)