• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=xcore | FileCheck %s
2
3; CHECK-LABEL: f0Test
4; CHECK: entsp 1
5; CHECK: bl f0
6; CHECK: retsp 1
7%struct.st0 = type { [0 x i32] }
8declare void @f0(%struct.st0*) nounwind
9define void @f0Test(%struct.st0* byval %s0) nounwind {
10entry:
11  call void @f0(%struct.st0* %s0) nounwind
12  ret void
13}
14
15; CHECK-LABEL: f1Test
16; CHECK: entsp 13
17; CHECK: stw r4, sp[12]
18; CHECK: stw r5, sp[11]
19; CHECK: mov r4, r0
20; CHECK: ldaw r5, sp[1]
21; CHECK: ldc r2, 40
22; CHECK: mov r0, r5
23; CHECK: bl memcpy
24; CHECK: mov r0, r5
25; CHECK: bl f1
26; CHECK: mov r0, r4
27; CHECK: ldw r5, sp[11]
28; CHECK: ldw r4, sp[12]
29; CHECK: retsp 13
30%struct.st1 = type { [10 x i32] }
31declare void @f1(%struct.st1*) nounwind
32define i32 @f1Test(i32 %i, %struct.st1* byval %s1) nounwind {
33entry:
34  call void @f1(%struct.st1* %s1) nounwind
35  ret i32 %i
36}
37
38; CHECK-LABEL: f2Test
39; CHECK: extsp 4
40; CHECK: stw lr, sp[1]
41; CHECK: stw r2, sp[3]
42; CHECK: stw r3, sp[4]
43; CHECK: ldw r0, r0[0]
44; CHECK: stw r0, sp[2]
45; CHECK: ldaw r2, sp[2]
46; CHECK: mov r0, r1
47; CHECK: mov r1, r2
48; CHECK: bl f2
49; CHECK: ldw lr, sp[1]
50; CHECK: ldaw sp, sp[4]
51; CHECK: retsp 0
52%struct.st2 = type { i32 }
53declare void @f2(i32, %struct.st2*) nounwind
54define void @f2Test(%struct.st2* byval %s2, i32 %i, ...) nounwind {
55entry:
56  call void @f2(i32 %i, %struct.st2* %s2)
57  ret void
58}
59