1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
3 ; RUN: | FileCheck %s --check-prefix=RV32I
4 ; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5 ; RUN: | FileCheck %s --check-prefix=RV64I
7 define void @cast0(i32 addrspace(1)* %ptr) {
10 ; RV32I-NEXT: sw zero, 0(a0)
15 ; RV64I-NEXT: sw zero, 0(a0)
17 %ptr0 = addrspacecast i32 addrspace(1)* %ptr to i32 addrspace(0)*
18 store i32 0, i32* %ptr0
22 define void @cast1(i32* %ptr) {
25 ; RV32I-NEXT: addi sp, sp, -16
26 ; RV32I-NEXT: .cfi_def_cfa_offset 16
27 ; RV32I-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
28 ; RV32I-NEXT: .cfi_offset ra, -4
29 ; RV32I-NEXT: call foo@plt
30 ; RV32I-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
31 ; RV32I-NEXT: addi sp, sp, 16
36 ; RV64I-NEXT: addi sp, sp, -16
37 ; RV64I-NEXT: .cfi_def_cfa_offset 16
38 ; RV64I-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
39 ; RV64I-NEXT: .cfi_offset ra, -8
40 ; RV64I-NEXT: call foo@plt
41 ; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
42 ; RV64I-NEXT: addi sp, sp, 16
44 %castptr = addrspacecast i32* %ptr to i32 addrspace(10)*
45 call void @foo(i32 addrspace(10)* %castptr)
49 declare void @foo(i32 addrspace(10)*)