public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] Correct testcase gcc.target/bfin/20090914-3.c
@ 2021-10-24 13:31 Roger Sayle
  0 siblings, 0 replies; only message in thread
From: Roger Sayle @ 2021-10-24 13:31 UTC (permalink / raw)
  To: 'GCC Patches'

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]


This patch cures the testsuite failure of bfin/20090914-3.c, which
currently FAILs on bfin-elf with "(test for excess errors)" due to:
20090914-3.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
which is obviously not what this code was intended to test.  Fixed by
turning the code into a function returning the final "fract32" result,
as simply specifying an "int" return type for main, results in the
entire function being optimized away, as the result is unused.

Checked-in as obvious.


2021-10-24  Roger Sayle  <roger@nextmovesoftware.com>

gcc/testsuite/ChangeLog
	* gcc.target/bfin/20090914-3.c: Tweak test case.

Roger
--


[-- Attachment #2: patchj.txt --]
[-- Type: text/plain, Size: 634 bytes --]

diff --git a/gcc/testsuite/gcc.target/bfin/20090914-3.c b/gcc/testsuite/gcc.target/bfin/20090914-3.c
index fb0a9e1..6be5528 100644
--- a/gcc/testsuite/gcc.target/bfin/20090914-3.c
+++ b/gcc/testsuite/gcc.target/bfin/20090914-3.c
@@ -1,10 +1,11 @@
 /* { dg-do compile { target bfin-*-* } } */
 typedef long fract32;
-main() {
+fract32 foo() {
   fract32 val_tmp;
   fract32 val1 = 0x7FFFFFFF;
   fract32 val2 = 0x40000000;
   val_tmp = __builtin_bfin_mult_fr1x32x32 (0x06666667, val1);
   val2 = __builtin_bfin_mult_fr1x32x32 (0x79999999, val2);
   val2 = __builtin_bfin_add_fr1x32 (val_tmp, val2);
+  return val2;
 }

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

only message in thread, other threads:[~2021-10-24 13:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 13:31 [Committed] Correct testcase gcc.target/bfin/20090914-3.c Roger Sayle

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).