loongarch: testsuite: adapt stack-usage-1.c for LP64
authorXi Ruoyao <xry111@mengyan1223.wang>
Fri, 8 Apr 2022 17:58:40 +0000 (01:58 +0800)
committerXi Ruoyao <xry111@mengyan1223.wang>
Sat, 9 Apr 2022 11:41:53 +0000 (19:41 +0800)
LoongArch backend allocates two additional 8-byte stack slots for LP64,
one for saving $fp and another for saving the temporary value "1".
Ideally they are both unneeded, but (1) we're using -O0 so the code is
suboptimized by the nature; (2) any improvement (if possible) should be
deferred to GCC 13.  So for now simply adjust the test to make it pass.

gcc/testsuite/

* gcc.dg/stack-usage-1.c: Adjust for LoongArch LP64.

gcc/testsuite/gcc.dg/stack-usage-1.c

index 1d7d1fe..21cce0f 100644 (file)
 #  define SIZE 252
 #elif defined (__CRIS__)
 #  define SIZE 252
+#elif defined (__loongarch_lp64)
+#  define SIZE 240   /* 256 - 8 bytes for $fp, and 8 bytes for a temp value */
 #else
 #  define SIZE 256
 #endif