public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1558] RISC-V] add TC for save-restore cfi directives.
@ 2023-06-06  2:16 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-06-06  2:16 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d1344c418005927e2c39d8285ec63461d72a6717

commit r14-1558-gd1344c418005927e2c39d8285ec63461d72a6717
Author: Fei Gao <gaofei@eswincomputing.com>
Date:   Mon Jun 5 20:14:33 2023 -0600

    RISC-V] add TC for save-restore cfi directives.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/riscv/save-restore-cfi.c: New test to check save-restore
            cfi directives.

Diff:
---
 gcc/testsuite/gcc.target/riscv/save-restore-cfi.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/testsuite/gcc.target/riscv/save-restore-cfi.c b/gcc/testsuite/gcc.target/riscv/save-restore-cfi.c
new file mode 100644
index 00000000000..a39f3060981
--- /dev/null
+++ b/gcc/testsuite/gcc.target/riscv/save-restore-cfi.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-g -Os -march=rv32imafc -mabi=ilp32f -msave-restore -mcmodel=medlow" } */
+/* { dg-skip-if "" { *-*-* } {"-O2" "-O1" "-O0" "-Og" "-O3" "-Oz" "-flto"} } */
+/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 16} 2} } */
+/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 32} 1} } */
+/* { dg-final { scan-assembler-times {\.cfi_def_cfa_offset 0} 1} } */
+
+char my_getchar();
+float getf();
+
+int foo()
+{
+  int s0 = my_getchar();
+  float f0 = getf();
+  int b = my_getchar();
+  return f0 + s0 + b;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-06  2:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-06  2:16 [gcc r14-1558] RISC-V] add TC for save-restore cfi directives Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).