This change handles a another case for generating the bic instruction
[oota-llvm.git] / test / CodeGen / ARM / struct_byval.ll
1 ; 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
7 define i32 @f() nounwind ssp {
8 entry:
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
19 define i32 @g() nounwind ssp {
20 entry:
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
31 declare i32 @e1(%struct.SmallStruct* nocapture byval %in) nounwind
32 declare i32 @e2(%struct.LargeStruct* nocapture byval %in) nounwind