[Committed] Correct testcase gcc.target/bfin/20090914-3.c
Commit Message
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
--
@@ -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;
}