From: Roger Sayle Date: Sun, 24 Oct 2021 13:30:10 +0000 (+0100) Subject: [Committed] Correct testcase gcc.target/bfin/20090914-3.c X-Git-Tag: basepoints/gcc-13~3668 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d1727a30e4b3e02f20e310d8e1fe2a6944883be;p=thirdparty%2Fgcc.git [Committed] Correct testcase gcc.target/bfin/20090914-3.c 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. 2021-10-24 Roger Sayle gcc/testsuite/ChangeLog * gcc.target/bfin/20090914-3.c: Tweak test case. --- diff --git a/gcc/testsuite/gcc.target/bfin/20090914-3.c b/gcc/testsuite/gcc.target/bfin/20090914-3.c index fb0a9e16c731..6be5528bf4d6 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; }