1 ; RUN: llc -verify-machineinstrs -mcpu=ppc64 -O0 -fast-isel=false < %s | FileCheck %s
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.
7 target 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"
8 target triple = "powerpc64-unknown-linux-gnu"
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] }
15 define void @test(ptr byval(%struct.S3) %s3, ptr byval(%struct.S5) %s5, ptr byval(%struct.S6) %s6, ptr byval(%struct.S7) %s7) nounwind {
17 call void @check(ptr byval(%struct.S3) %s3, ptr byval(%struct.S5) %s5, ptr byval(%struct.S6) %s6, ptr byval(%struct.S7) %s7)
22 ; CHECK: stb 6, 191(1)
23 ; CHECK: rldicl 7, 6, 56, 8
24 ; CHECK: sth 7, 189(1)
25 ; CHECK: rldicl 6, 6, 40, 24
26 ; CHECK: stw 6, 185(1)
27 ; CHECK: sth 5, 182(1)
28 ; CHECK: rldicl 5, 5, 48, 16
29 ; CHECK: stw 5, 178(1)
30 ; CHECK: stb 4, 175(1)
31 ; CHECK: rldicl 4, 4, 56, 8
32 ; CHECK: stw 4, 171(1)
33 ; CHECK: stb 3, 167(1)
34 ; CHECK: rldicl 3, 3, 56, 8
35 ; CHECK: sth 3, 165(1)
36 ; CHECK-DAG: lbz {{[0-9]+}}, 167(1)
37 ; CHECK-DAG: lhz {{[0-9]+}}, 165(1)
38 ; CHECK-DAG: stb {{[0-9]+}}, 55(1)
39 ; CHECK-DAG: sth {{[0-9]+}}, 53(1)
40 ; CHECK-DAG: lbz {{[0-9]+}}, 175(1)
41 ; CHECK-DAG: lwz {{[0-9]+}}, 171(1)
42 ; CHECK-DAG: stb {{[0-9]+}}, 63(1)
43 ; CHECK-DAG: stw {{[0-9]+}}, 59(1)
44 ; CHECK-DAG: lhz {{[0-9]+}}, 182(1)
45 ; CHECK-DAG: lwz {{[0-9]+}}, 178(1)
46 ; CHECK-DAG: sth {{[0-9]+}}, 70(1)
47 ; CHECK-DAG: stw {{[0-9]+}}, 66(1)
48 ; CHECK-DAG: lwz {{[0-9]+}}, 188(1)
49 ; CHECK-DAG: lwz {{[0-9]+}}, 185(1)
50 ; CHECK-DAG: stw {{[0-9]+}}, 76(1)
51 ; CHECK-DAG: stw {{[0-9]+}}, 73(1)
52 ; CHECK-DAG: ld 6, 72(1)
53 ; CHECK-DAG: ld 5, 64(1)
54 ; CHECK-DAG: ld 4, 56(1)
55 ; CHECK-DAG: ld 3, 48(1)
57 declare void @check(ptr byval(%struct.S3), ptr byval(%struct.S5), ptr byval(%struct.S6), ptr byval(%struct.S7))