This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[SH][committed] Fix fpchg testcase
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 16 Dec 2014 22:32:12 +0100
- Subject: [SH][committed] Fix fpchg testcase
- Authentication-results: sourceware.org; auth=none
Hi,
The attached patch fixes the gcc.target/sh/fpchg.c test case. The test
case actually never worked since it requires at least -O option to
output the expected fpchg insn. Moreover, scan-assembler "fpchg" would
match on the file name string in the asm output. Fixed and tested with
make check-gcc RUNTESTFLAGS="sh.exp=pr53513-1.c --target_board=sh-sim
\{-m4a/-ml,-m4a/-mb,-m4a-single/-ml,-m4a-single/-mb,-m4a-nofpu/-ml,-m4a-nofpu/-mb}". Commited as r218793.
Cheers,
Oleg
gcc/testsuite/ChangeLog:
PR target/53513
* gcc.target/sh/fpchg.c: Rename to ...
* gcc.target/sh/pr53513-1.c: ... this. Adjust test case to work for
-m4a and -m4a-single.
Index: gcc/testsuite/gcc.target/sh/pr53513-1.c
===================================================================
--- gcc/testsuite/gcc.target/sh/pr53513-1.c (revision 0)
+++ gcc/testsuite/gcc.target/sh/pr53513-1.c (revision 0)
@@ -0,0 +1,11 @@
+/* Check that fpchg is used to switch FPSCR.PR mode on SH4A. */
+/* { dg-additional-options "-O" } */
+/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" } } */
+/* { dg-final { scan-assembler "fpchg" } } */
+/* { dg-final { scan-assembler-not "fpscr" } } */
+
+double
+foo (float a, float b, double c)
+{
+ return (a * b) + c;
+}
Index: gcc/testsuite/gcc.target/sh/fpchg.c
===================================================================
--- gcc/testsuite/gcc.target/sh/fpchg.c (revision 218791)
+++ gcc/testsuite/gcc.target/sh/fpchg.c (working copy)
@@ -1,17 +0,0 @@
-/* Check that fpchg is used to switch precision. */
-
-/* { dg-do compile } */
-/* { dg-final { scan-assembler "fpchg" } } */
-/* { dg-final { scan-assembler-not "fpscr" } } */
-/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" } } */
-
-extern float c;
-
-void
-foo(int j)
-{
- while (j--)
- c++;
-
-}
-