]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | /* Copyright 2021-2024 Free Software Foundation, Inc. |
2b014cc5 LS |
2 | |
3 | This program is free software; you can redistribute it and/or modify | |
4 | it under the terms of the GNU General Public License as published by | |
5 | the Free Software Foundation; either version 3 of the License, or | |
6 | (at your option) any later version. | |
7 | ||
8 | This program is distributed in the hope that it will be useful, | |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | GNU General Public License for more details. | |
12 | ||
13 | You should have received a copy of the GNU General Public License | |
14 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
15 | ||
16 | /* This testcase contains a function where the 'c.mv' instruction is used in | |
17 | the prologue. | |
18 | ||
19 | The following functions are roughly equivalent to the following C code (with | |
20 | prologue crafted to contain the c.mv instruction): | |
21 | ||
22 | int bar () { return 0; } | |
23 | int foo () { return bar (); } */ | |
24 | ||
25 | .option pic | |
26 | .text | |
27 | .align 1 | |
28 | .globl bar | |
29 | .type bar, @function | |
30 | bar: | |
31 | li a0,0 | |
32 | jr ra | |
33 | .size bar, .-bar | |
34 | ||
35 | .align 1 | |
36 | .globl foo | |
37 | .type foo, @function | |
38 | foo: | |
39 | addi sp,sp,-32 | |
40 | c.mv t3,ra | |
41 | sd t3,8(sp) | |
42 | call bar | |
43 | ld t3,8(sp) | |
44 | mv ra,t3 | |
45 | addi sp,sp,32 | |
46 | jr ra | |
47 | .size foo, .-foo | |
0f2cd53c | 48 | .section .note.GNU-stack,"",@progbits |