[RISC-V] add TC for save-restore cfi directives.
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gcc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 |
success
|
Testing passed
|
Commit Message
gcc/testsuite/ChangeLog:
* gcc.target/riscv/save-restore-cfi.c: New test to check save-restore cfi directives.
---
.../gcc.target/riscv/save-restore-cfi.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/riscv/save-restore-cfi.c
Comments
On 6/5/23 00:07, Fei Gao wrote:
> gcc/testsuite/ChangeLog:
>
> * gcc.target/riscv/save-restore-cfi.c: New test to check save-restore cfi directives.
Wrapped the ChangeLog to 80 columns and pushed to the trunk.
Thanks,
Jeff
new file mode 100644
@@ -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;
+}