On Thu, 2022-07-07 at 18:30 +0800, Lulu Cheng wrote: /* snip */
> diff --git a/gcc/testsuite/gcc.target/loongarch/prolog-opt.c > b/gcc/testsuite/gcc.target/loongarch/prolog-opt.c > new file mode 100644 > index 00000000000..c7bd71dde93 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/loongarch/prolog-opt.c > @@ -0,0 +1,15 @@ > +/* Test that LoongArch backend stack drop operation optimized. */ > + > +/* { dg-do compile } */ > +/* { dg-options "-O2 -mabi=lp64d" } */ > +/* { dg-final { scan-assembler "addi.d\t\\\$r3,\\\$r3,-16" } } */ > + > +#include <stdio.h> It's better to hard code "extern int printf(char *, ...);" here, so the test case won't unnecessarily depend on libc header. LGTM otherwise. > + > +int main() > +{ > + char buf[1024 * 12]; > + printf ("%p\n", buf); > + return 0; > +} > +