diff mbox

[SH,committed] Fix fpchg testcase

Message ID 1418765532.8915.8.camel@yam-132-YW-E178-FTW
State New
Headers show

Commit Message

Oleg Endo Dec. 16, 2014, 9:32 p.m. UTC
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.
diff mbox

Patch

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++;
-
-}
-