Testcase for call expression involving arguments in volatile registers #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
为 Step 9 增加一个测例
arg_swap
:这对应着 Step 9 实验指导中的两处:
如果处理参数接收时采用了将输入参数直接绑定到寄存器(而非实验指导中推荐的将输入参数先从寄存器中存放至栈上)的做法,并且处理函数调用时采用直接将参数从一个寄存器复制到目标参数寄存器的做法,却没有妥善处理实参所处寄存器也是参数寄存器的情况,没有将实参所处寄存器解绑定,可能会出现调用
g
时,对第一个参数的传参直接生成mv a0, a1
,导致输入参数x
的值被覆盖,最终造成计算结果错误。