blob: 8869537425b77551f811aad0874480e316a1b7d1 [file] [log] [blame]
David Peixotto8e5abc52013-10-17 19:52:05 +00001; RUN: llc -mtriple thumbv5-none-linux-gnueabi < %s | FileCheck %s
2
3%struct.C = type { [1000 x i8] }
4%struct.S = type { [1000 x i16] }
5%struct.I = type { [1000 x i32] }
6
7;CHECK-LABEL: pass_C:
8;CHECK-NOT: ldrb r{{[0-9]+}}, [{{.*}}], #1
9;CHECK-NOT: strb r{{[0-9]+}}, [{{.*}}], #1
10define void @pass_C() #0 {
11entry:
12 %c = alloca %struct.C, align 1
David Blaikie79e6c742015-02-27 19:29:02 +000013 %0 = getelementptr inbounds %struct.C, %struct.C* %c, i32 0, i32 0, i32 0
Matt Arsenaultf10061e2017-04-10 20:18:21 +000014 call void @llvm.lifetime.start.p0i8(i64 1000, i8* %0) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000015 call void @use_C(%struct.C* byval %c) #3
Matt Arsenaultf10061e2017-04-10 20:18:21 +000016 call void @llvm.lifetime.end.p0i8(i64 1000, i8* %0) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000017 ret void
18}
19
20;CHECK-LABEL: pass_S:
21;CHECK-NOT: ldrh r{{[0-9]+}}, [{{.*}}], #2
22;CHECK-NOT: strh r{{[0-9]+}}, [{{.*}}], #2
23define void @pass_S() #0 {
24entry:
25 %s = alloca %struct.S, align 2
26 %0 = bitcast %struct.S* %s to i8*
Matt Arsenaultf10061e2017-04-10 20:18:21 +000027 call void @llvm.lifetime.start.p0i8(i64 2000, i8* %0) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000028 call void @use_S(%struct.S* byval %s) #3
Matt Arsenaultf10061e2017-04-10 20:18:21 +000029 call void @llvm.lifetime.end.p0i8(i64 2000, i8* %0) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000030 ret void
31}
32
33;CHECK-LABEL: pass_I:
34;CHECK-NOT: ldr r{{[0-9]+}}, [{{.*}}], #4
35;CHECK-NOT: str r{{[0-9]+}}, [{{.*}}], #4
36define void @pass_I() #0 {
37entry:
38 %i = alloca %struct.I, align 4
39 %0 = bitcast %struct.I* %i to i8*
Matt Arsenaultf10061e2017-04-10 20:18:21 +000040 call void @llvm.lifetime.start.p0i8(i64 4000, i8* %0) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000041 call void @use_I(%struct.I* byval %i) #3
Matt Arsenaultf10061e2017-04-10 20:18:21 +000042 call void @llvm.lifetime.end.p0i8(i64 4000, i8* %0) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000043 ret void
44}
45
46declare void @use_C(%struct.C* byval) #2
47declare void @use_S(%struct.S* byval) #2
48declare void @use_I(%struct.I* byval) #2
49
Matt Arsenaultf10061e2017-04-10 20:18:21 +000050declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) #1
51declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #1
David Peixotto8e5abc52013-10-17 19:52:05 +000052
53
54attributes #0 = { nounwind optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
55attributes #1 = { nounwind }
56attributes #2 = { optsize "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
57attributes #3 = { nounwind optsize }