]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Make stack_save_restore tests more robust
authorJeff Law <jlaw@ventanamicro.com>
Fri, 25 Aug 2023 22:34:17 +0000 (16:34 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 25 Aug 2023 22:34:17 +0000 (16:34 -0600)
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.

gcc/testsuite/gcc.target/riscv/stack_save_restore_1.c
gcc/testsuite/gcc.target/riscv/stack_save_restore_2.c

index 255ce5f40c9e300cbcc245d69a045bed2b65d02b..d8b0668a820fe72e401aa9be21adbf7cb13f3f9b 100644 (file)
@@ -8,15 +8,15 @@ float getf();
 /*
 ** 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()
index 4ce5e0118a499136f625c0333c71e98417014851..4c549cb11aee336d64239c9d3004b9cfdd3e393c 100644 (file)
@@ -8,15 +8,15 @@ float getf();
 /*
 ** 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()