blob: a10c5ddb36fb167e5792de807f4499a79e34bc41 [file] [log] [blame]
Bill Schmidt37900c52012-10-25 13:38:09 +00001; RUN: llc -mcpu=pwr7 -O0 < %s | FileCheck %s
2
3; This tests receiving and re-passing parameters consisting of structures
4; of size 3, 5, 6, and 7. They are to be found/placed right-adjusted in
5; the parameter registers.
6
7target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64"
8target triple = "powerpc64-unknown-linux-gnu"
9
10%struct.S3 = type { [3 x i8] }
11%struct.S5 = type { [5 x i8] }
12%struct.S6 = type { [6 x i8] }
13%struct.S7 = type { [7 x i8] }
14
15define void @test(%struct.S3* byval %s3, %struct.S5* byval %s5, %struct.S6* byval %s6, %struct.S7* byval %s7) nounwind {
16entry:
17 call void @check(%struct.S3* byval %s3, %struct.S5* byval %s5, %struct.S6* byval %s6, %struct.S7* byval %s7)
18 ret void
19}
20
21; CHECK: std 6, 216(1)
22; CHECK: std 5, 208(1)
23; CHECK: std 4, 200(1)
24; CHECK: std 3, 192(1)
25; CHECK: lbz {{[0-9]+}}, 199(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000026; CHECK: lhz {{[0-9]+}}, 197(1)
Bill Schmidt37ef8052013-03-27 02:40:14 +000027; CHECK: stb {{[0-9]+}}, 55(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000028; CHECK: sth {{[0-9]+}}, 53(1)
29; CHECK: lbz {{[0-9]+}}, 207(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000030; CHECK: lwz {{[0-9]+}}, 203(1)
Bill Schmidt37ef8052013-03-27 02:40:14 +000031; CHECK: stb {{[0-9]+}}, 63(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000032; CHECK: stw {{[0-9]+}}, 59(1)
33; CHECK: lhz {{[0-9]+}}, 214(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000034; CHECK: lwz {{[0-9]+}}, 210(1)
Bill Schmidt37ef8052013-03-27 02:40:14 +000035; CHECK: sth {{[0-9]+}}, 70(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000036; CHECK: stw {{[0-9]+}}, 66(1)
37; CHECK: lbz {{[0-9]+}}, 223(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000038; CHECK: lhz {{[0-9]+}}, 221(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000039; CHECK: lwz {{[0-9]+}}, 217(1)
Bill Schmidt37ef8052013-03-27 02:40:14 +000040; CHECK: stb {{[0-9]+}}, 79(1)
41; CHECK: sth {{[0-9]+}}, 77(1)
Bill Schmidt37900c52012-10-25 13:38:09 +000042; CHECK: stw {{[0-9]+}}, 73(1)
43; CHECK: ld 6, 72(1)
44; CHECK: ld 5, 64(1)
45; CHECK: ld 4, 56(1)
46; CHECK: ld 3, 48(1)
47
48declare void @check(%struct.S3* byval, %struct.S5* byval, %struct.S6* byval, %struct.S7* byval)