Spurred by Jivan's patch and a desire for cleaner testresults, I went ahead and
make the stack_save_restore tests independent of the precise stack size by
using a regexp.
gcc/testsuite/
* gcc.target/riscv/stack_save_restore_1.c: Robustify.
* gcc.target/riscv/stack_save_restore_2.c: Robustify.
/*
** bar:
** call t0,__riscv_save_(3|4)
-** addi sp,sp,-2032
+** addi sp,sp,-[0-9]+
** ...
-** li t0,-12288
+** li t0,-[0-9]+
** add sp,sp,t0
** ...
-** li t0,12288
+** li t0,[0-9]+
** add sp,sp,t0
** ...
-** addi sp,sp,2032
+** addi sp,sp,[0-9]+
** tail __riscv_restore_(3|4)
*/
int bar()
/*
** bar:
** call t0,__riscv_save_(3|4)
-** addi sp,sp,-2032
+** addi sp,sp,-[0-9]+
** ...
-** li t0,-12288
+** li t0,-[0-9]+
** add sp,sp,t0
** ...
-** li t0,12288
+** li t0,[0-9]+
** add sp,sp,t0
** ...
-** addi sp,sp,2032
+** addi sp,sp,[0-9]+
** tail __riscv_restore_(3|4)
*/
int bar()