* support/regression/ports/host/spec.mk: added m library
* support/regression/ports/mcs51-stack-auto/spec.mk: added float funcs
* support/regression/tests/float_trans: added (for Eric)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2937
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2003-10-13 Bernhard Held <bernhard@bernhardheld.de>
+
+ * device/lib/logf.c: "fixed" overlay bug
+ * support/regression/ports/host/spec.mk: added m library
+ * support/regression/ports/mcs51-stack-auto/spec.mk: added float funcs
+ * support/regression/tests/float_trans: added (for Eric)
+
2003-10-12 Bernhard Held <bernhard@bernhardheld.de>
* src/mcs51/gen.c (genCpl): fixed bug
float logf(const float x) reentrant
{
- float Rz, f, z, w, znum, zden, xn;
+#if defined(SDCC_mcs51) && defined(SDCC_MODEL_SMALL) \
+ && !defined(SDCC_NOOVERLAY)
+ volatile
+#endif
+ float Rz;
+ float f, z, w, znum, zden, xn;
int n;
if (x<=0.0)
-grep -n FAIL $@ /dev/null || true
%$(EXEEXT): %$(OBJEXT) $(EXTRAS)
- $(SDCC) $(SDCCFLAGS) -o $@ $< $(EXTRAS)
+ $(SDCC) $(SDCCFLAGS) -o $@ $< $(EXTRAS) -lm
%$(OBJEXT): %.c
$(SDCC) $(SDCCFLAGS) -c $< -o $@
_divulong.c _fs2schar.c _fs2sint.c _fs2slong.c \
_fs2uchar.c _fs2uint.c _fs2ulong.c _fsadd.c \
_fsdiv.c _fseq.c _fsgt.c _fslt.c _fsmul.c \
+ fabsf.c sqrtf.c logf.c log10f.c powf.c tanf.c \
+ errno.c frexpf.c ldexpf.c tancotf.c \
_fsneq.c _fssub.c _gptrget.c _gptrput.c \
_sint2fs.c _iscntrl.c _isdigit.c _isgraph.c \
_islower.c _isprint.c _ispunct.c _isspace.c \
--- /dev/null
+/* Test of transcendent float functions.
+ Original from Jesus Calvino-Fraga
+
+ func: SQRTF, LOGF, POWF, TANF
+*/
+#include <testfwk.h>
+#include <math.h>
+
+#define {func} 1
+
+void
+testTrans(void)
+{
+#ifndef SDCC_z80
+# ifdef SQRTF
+ ASSERT(fabsf (sqrtf (5.0) - 2.23606801) < 0.00001);
+# endif
+# ifdef LOGF
+ ASSERT(fabsf (logf (124.0) - 4.82028150) < 0.00001);
+ ASSERT(fabsf (log10f (124.0) - 2.09342169) < 0.00001);
+# endif
+# ifdef POWF
+ /* too big for small modell */
+# ifndef SDCC_MODEL_SMALL
+ ASSERT(fabsf (powf (1.5, 2.0) - 2.24999976) < 0.00001);
+# endif
+# endif
+# ifdef TANF
+ ASSERT(fabsf (tanf (1.6) - -34.23250579) < 0.00001);
+# endif
+#endif
+}