File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed 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+
7+ pub struct SomeComplexType {
8+ a : u64 ,
9+ b : u64 ,
10+ c : u64 ,
11+ }
12+
13+ // CHECK-LABEL: with_mut_param
14+ #[ no_mangle]
15+ pub fn with_mut_param ( mut a : SomeComplexType ) -> SomeComplexType {
16+ // CHECK: ld a2, 0(a1)
17+ // CHECK-NEXT: ld a3, 8(a1)
18+ // CHECK-NEXT: ld a4, 16(a1)
19+ // CHECK-NEXT: addi a2, a2, 10
20+ // CHECK-NEXT: addi a3, a3, 2
21+ // CHECK-NEXT: sd a2, 0(a1)
22+ // CHECK-NEXT: sd a3, 8(a1)
23+ // CHECK-NEXT: sd a2, 0(a0)
24+ // CHECK-NEXT: sd a3, 8(a0)
25+ // CHECK-NEXT: sd a4, 16(a0)
26+ // CHECK-NEXT: ret
27+ a. a += 10 ;
28+ a. b += 2 ;
29+ a
30+ }
31+
32+ fn main ( ) { }
33+
34+
35+
You can’t perform that action at this time.
0 commit comments