Patchwork [testsuite] Directly declare sqrtf in gcc.dg/pr51867.c

login
register
mail settings
Submitter Rainer Orth
Date Feb. 15, 2012, 5:55 p.m.
Message ID <yddk43ougku.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/141351/
State New
Headers show

Comments

Rainer Orth - Feb. 15, 2012, 5:55 p.m.
gcc.dg/pr51867.c currently FAILs on Solaris 8 and 9:

FAIL: gcc.dg/pr51867.c (test for excess errors)
Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/pr51867.c:7:12: warning: incomp
atible implicit declaration of built-in function 'sqrtf' [enabled by default]
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/pr51867.c:11:12: warning: incom
patible implicit declaration of built-in function 'sqrtf' [enabled by default]

which is no wonder since those targets lack a C99 libm.  This can easily
be avoided by simply declaring sqrtf directly, which the following patch
does.

Tested with the appropriate runtest invocations on i386-pc-solaris2.8,
i386-pc-solaris2.11, and x86_64-unknown-linux-gnu, installed on
mainline.

	Rainer


2012-02-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/pr51867.c: Don't include <math.h>.
	(sqrtf): Declare.

Patch

# HG changeset patch
# Parent f4216d8e89ea5facd439f8fc1d0ff36670667b36
Directly declare sqrtf in gcc.dg/pr51867.c

diff --git a/gcc/testsuite/gcc.dg/pr51867.c b/gcc/testsuite/gcc.dg/pr51867.c
--- a/gcc/testsuite/gcc.dg/pr51867.c
+++ b/gcc/testsuite/gcc.dg/pr51867.c
@@ -1,6 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O0 -fno-math-errno -fdump-rtl-expand" } */
-#include <math.h>
+
+extern float sqrtf(float);
 
 float a(float x)
 {