1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck -check-prefix=RV32I %s
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck -check-prefix=RV64I %s
7 ; Tests that the 'nest' parameter attribute causes the relevant parameter to be
8 ; passed in the right register.
10 define ptr @nest_receiver(ptr nest %arg) nounwind {
11 ; RV32I-LABEL: nest_receiver:
13 ; RV32I-NEXT: mv a0, t2
16 ; RV64I-LABEL: nest_receiver:
18 ; RV64I-NEXT: mv a0, t2
24 define ptr @nest_caller(ptr %arg) nounwind {
25 ; RV32I-LABEL: nest_caller:
27 ; RV32I-NEXT: addi sp, sp, -16
28 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
29 ; RV32I-NEXT: mv t2, a0
30 ; RV32I-NEXT: call nest_receiver@plt
31 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
32 ; RV32I-NEXT: addi sp, sp, 16
35 ; RV64I-LABEL: nest_caller:
37 ; RV64I-NEXT: addi sp, sp, -16
38 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
39 ; RV64I-NEXT: mv t2, a0
40 ; RV64I-NEXT: call nest_receiver@plt
41 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
42 ; RV64I-NEXT: addi sp, sp, 16
45 %result = call ptr @nest_receiver(ptr nest %arg)