File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ //! Regression test for <https://github.com/rust-lang/rust/issues/149762>:
2+
3+ //@ assembly-output: emit-asm
4+ //@ compile-flags: -Copt-level=3 --target riscv64gc-unknown-linux-gnu
5+ //@ needs-llvm-components: riscv
6+ //@ only-riscv64
7+
8+ pub struct SomeComplexType {
9+ a : u64 ,
10+ b : u64 ,
11+ c : u64 ,
12+ }
13+
14+ // CHECK-LABEL: with_mut_param
15+ #[ no_mangle]
16+ pub fn with_mut_param ( mut a : SomeComplexType ) -> SomeComplexType {
17+ // CHECK: ld a2, 0(a1)
18+ // CHECK-NEXT: ld a3, 8(a1)
19+ // CHECK-NEXT: ld a4, 16(a1)
20+ // CHECK-NEXT: addi a2, a2, 10
21+ // CHECK-NEXT: addi a3, a3, 2
22+ // CHECK-NEXT: sd a2, 0(a1)
23+ // CHECK-NEXT: sd a3, 8(a1)
24+ // CHECK-NEXT: sd a2, 0(a0)
25+ // CHECK-NEXT: sd a3, 8(a0)
26+ // CHECK-NEXT: sd a4, 16(a0)
27+ // CHECK-NEXT: ret
28+ a. a += 10 ;
29+ a. b += 2 ;
30+ a
31+ }
32+
33+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments