blob: 0c2f7398cb7173460885475e65d7f009f06e7e68 [file] [log] [blame]
Manman Renbe4258a2012-06-02 05:37:44 +00001; RUN: llc < %s -mtriple=armv7-apple-ios6.0 | FileCheck %s
2
3; rdar://9877866
4%struct.SmallStruct = type { i32, [8 x i32], [37 x i8] }
5%struct.LargeStruct = type { i32, [1001 x i8], [300 x i32] }
6
7define i32 @f() nounwind ssp {
8entry:
9; CHECK: f:
10; CHECK: ldr
11; CHECK: str
12; CHECK-NOT:bne
13 %st = alloca %struct.SmallStruct, align 4
14 %call = call i32 @e1(%struct.SmallStruct* byval %st)
15 ret i32 0
16}
17
18; Generate a loop for large struct byval
19define i32 @g() nounwind ssp {
20entry:
21; CHECK: g:
22; CHECK: ldr
23; CHECK: sub
24; CHECK: str
25; CHECK: bne
26 %st = alloca %struct.LargeStruct, align 4
27 %call = call i32 @e2(%struct.LargeStruct* byval %st)
28 ret i32 0
29}
30
31declare i32 @e1(%struct.SmallStruct* nocapture byval %in) nounwind
32declare i32 @e2(%struct.LargeStruct* nocapture byval %in) nounwind