1 ; RUN: llc -mtriple=aarch64-linux-gnu %s -o - | FileCheck %s
3 define i8 @byval_match(i8* byval(i8) align 1, i8* byval %ptr) {
4 ; CHECK-LABEL: byval_match:
5 ; CHECK: ldrb w0, [sp, #8]
6 %res = load i8, i8* %ptr
10 define void @caller_match(i8* %p0, i8* %p1) {
11 ; CHECK-LABEL: caller_match:
12 ; CHECK: ldrb [[P1:w[0-9]+]], [x1]
13 ; CHECK: strb [[P1]], [sp, #8]
14 ; CHECK: ldrb [[P0:w[0-9]+]], [x0]
15 ; CHECK: strb [[P0]], [sp]
16 ; CHECK: bl byval_match
17 call i8 @byval_match(i8* byval(i8) align 1 %p0, i8* byval %p1)
21 define i8 @byval_large([3 x i64]* byval([3 x i64]) align 8, i8* byval %ptr) {
22 ; CHECK-LABEL: byval_large:
23 ; CHECK: ldrb w0, [sp, #24]
24 %res = load i8, i8* %ptr
28 define void @caller_large([3 x i64]* %p0, i8* %p1) {
29 ; CHECK-LABEL: caller_large:
30 ; CHECK: ldr [[P0HI:x[0-9]+]], [x0, #16]
31 ; CHECK: ldr [[P0LO:q[0-9]+]], [x0]
32 ; CHECK: str [[P0HI]], [sp, #16]
33 ; CHECK: str [[P0LO]], [sp]
34 ; CHECK: bl byval_large
35 call i8 @byval_large([3 x i64]* byval([3 x i64]) align 8 %p0, i8* byval %p1)