Updated the library version to 76:3:0.
libphobos/ChangeLog:
2018-11-28 Iain Buclaw <ibuclaw@gdcproject.org>
* Makefile.in: Rebuild.
* configure: Rebuild.
* configure.ac (DRUNTIME_SOVERSION): Remove.
(PHOBOS_SOVERSION): Remove.
(libtool_VERSION): Add.
* libdruntime/Makefile.am: Use libtool_VERSION.
* libdruntime/Makefile.in: Rebuild.
* src/Makefile.am: Use libtool_VERSION.
* src/Makefile.in: Rebuild.
* testsuite/Makefile.in: Rebuild.
From-SVN: r266572
+2018-11-28 Iain Buclaw <ibuclaw@gdcproject.org>
+
+ * Makefile.in: Rebuild.
+ * configure: Rebuild.
+ * configure.ac (DRUNTIME_SOVERSION): Remove.
+ (PHOBOS_SOVERSION): Remove.
+ (libtool_VERSION): Add.
+ * libdruntime/Makefile.am: Use libtool_VERSION.
+ * libdruntime/Makefile.in: Rebuild.
+ * src/Makefile.am: Use libtool_VERSION.
+ * src/Makefile.in: Rebuild.
+ * testsuite/Makefile.in: Rebuild.
+
2018-11-22 Johannes Pfau <johannespfau@gmail.com>
PR d/87824
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
-DRUNTIME_SOVERSION = @DRUNTIME_SOVERSION@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PHOBOS_SOVERSION = @PHOBOS_SOVERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
libphobos_srcdir = @libphobos_srcdir@
libphobos_toolexecdir = @libphobos_toolexecdir@
libphobos_toolexeclibdir = @libphobos_toolexeclibdir@
+libtool_VERSION = @libtool_VERSION@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
LTLIBOBJS
LIBOBJS
GDCFLAGSX
-PHOBOS_SOVERSION
-DRUNTIME_SOVERSION
+libtool_VERSION
SPEC_PHOBOS_DEPS
gdc_include_dir
libphobos_toolexeclibdir
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11512 "configure"
+#line 11511 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11618 "configure"
+#line 11617 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
# Libdruntime / phobos soname version
-DRUNTIME_SOVERSION="76:2:0"
-PHOBOS_SOVERSION="76:2:0"
-
+libtool_VERSION=76:3:0
# Set default flags (after DRUNTIME_WERROR!)
AC_SUBST(SPEC_PHOBOS_DEPS)
# Libdruntime / phobos soname version
-DRUNTIME_SOVERSION="76:2:0"
-PHOBOS_SOVERSION="76:2:0"
-AC_SUBST([DRUNTIME_SOVERSION])
-AC_SUBST([PHOBOS_SOVERSION])
+libtool_VERSION=76:3:0
+AC_SUBST(libtool_VERSION)
# Set default flags (after DRUNTIME_WERROR!)
if test -z "$GDCFLAGS"; then
toolexeclib_LTLIBRARIES = libgdruntime.la
libgdruntime_la_SOURCES = $(ALL_DRUNTIME_SOURCES)
libgdruntime_la_LIBTOOLFLAGS =
-libgdruntime_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(DRUNTIME_SOVERSION)
+libgdruntime_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
libgdruntime_la_LIBADD = $(LIBATOMIC) $(LIBBACKTRACE)
# For static unittest, link objects directly
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
-DRUNTIME_SOVERSION = @DRUNTIME_SOVERSION@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PHOBOS_SOVERSION = @PHOBOS_SOVERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
libphobos_srcdir = @libphobos_srcdir@
libphobos_toolexecdir = @libphobos_toolexecdir@
libphobos_toolexeclibdir = @libphobos_toolexeclibdir@
+libtool_VERSION = @libtool_VERSION@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
toolexeclib_LTLIBRARIES = libgdruntime.la
libgdruntime_la_SOURCES = $(ALL_DRUNTIME_SOURCES)
libgdruntime_la_LIBTOOLFLAGS =
-libgdruntime_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(DRUNTIME_SOVERSION)
+libgdruntime_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
libgdruntime_la_LIBADD = $(LIBATOMIC) $(LIBBACKTRACE)
# For static unittest, link objects directly
// comparisons in the semantic analysis phase of CmpExp. The ordering
// comparison is lowered to a call to this template.
int __cmp(T1, T2)(T1[] s1, T2[] s2)
-if (!__traits(isScalar, T1))
+if (!__traits(isScalar, T1) && !__traits(isScalar, T2))
{
import core.internal.traits : Unqual;
alias U1 = Unqual!T1;
alias U2 = Unqual!T2;
- static assert(is(U1 == U2), "Internal error.");
- static if (is(U1 == void))
+ static if (is(U1 == void) && is(U2 == void))
static @trusted ref inout(ubyte) at(inout(void)[] r, size_t i) { return (cast(inout(ubyte)*) r.ptr)[i]; }
else
static @trusted ref R at(R)(R[] r, size_t i) { return r.ptr[i]; }
{
// TODO: fix this legacy bad behavior, see
// https://issues.dlang.org/show_bug.cgi?id=17244
+ static assert(is(U1 == U2), "Internal error.");
import core.stdc.string : memcmp;
- return (() @trusted => memcmp(&at(s1, u), &at(s2, u), U1.sizeof))();
+ auto c = (() @trusted => memcmp(&at(s1, u), &at(s2, u), U1.sizeof))();
+ if (c != 0)
+ return c;
}
}
return s1.length < s2.length ? -1 : (s1.length > s2.length);
{
T[2] a = [T.max, T.max];
T[2] b = [T.min_normal, T.min_normal];
+ T[2] c = [T.max, T.min_normal];
+ T[1] d = [T.max];
assert(__cmp(a, b) > 0);
assert(__cmp(b, a) < 0);
+ assert(__cmp(a, c) > 0);
+ assert(__cmp(a, d) > 0);
+ assert(__cmp(d, c) < 0);
+ assert(__cmp(c, c) == 0);
}
compareMinMax!real;
assert(__cmp(b, a) < 0);
}
+// arrays of arrays with mixed modifiers
+@safe unittest
+{
+ // https://issues.dlang.org/show_bug.cgi?id=17876
+ bool less1(immutable size_t[][] a, size_t[][] b) { return a < b; }
+ bool less2(const void[][] a, void[][] b) { return a < b; }
+ bool less3(inout size_t[][] a, size_t[][] b) { return a < b; }
+
+ immutable size_t[][] a = [[1, 2], [3, 4]];
+ size_t[][] b = [[1, 2], [3, 5]];
+ assert(less1(a, b));
+ assert(less3(a, b));
+
+ auto va = [cast(immutable void[])a[0], a[1]];
+ auto vb = [cast(void[])b[0], b[1]];
+ assert(less2(va, vb));
+}
+
// objects
@safe unittest
{
assert(__cmp([c1, c1][], [c2, c2][]) < 0);
assert(__cmp([c2, c2], [c1, c1]) > 0);
+ assert(__cmp([c2, c2], [c2, c1]) > 0);
}
// Compiler hook into the runtime implementation of array (vector) operations.
toolexeclib_LTLIBRARIES = libgphobos.la
libgphobos_la_SOURCES = $(ALL_PHOBOS_SOURCES) $(ZLIB_SRC)
libgphobos_la_LIBTOOLFLAGS =
-libgphobos_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(PHOBOS_SOVERSION)
+libgphobos_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
libgphobos_la_LIBADD = ../libdruntime/libgdruntime.la
libgphobos_la_DEPENDENCIES = libgphobos.spec
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
-DRUNTIME_SOVERSION = @DRUNTIME_SOVERSION@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PHOBOS_SOVERSION = @PHOBOS_SOVERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
libphobos_srcdir = @libphobos_srcdir@
libphobos_toolexecdir = @libphobos_toolexecdir@
libphobos_toolexeclibdir = @libphobos_toolexeclibdir@
+libtool_VERSION = @libtool_VERSION@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
toolexeclib_LTLIBRARIES = libgphobos.la
libgphobos_la_SOURCES = $(ALL_PHOBOS_SOURCES) $(ZLIB_SRC)
libgphobos_la_LIBTOOLFLAGS =
-libgphobos_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(PHOBOS_SOVERSION)
+libgphobos_la_LDFLAGS = -Xcompiler -nophoboslib -version-info $(libtool_VERSION)
libgphobos_la_LIBADD = ../libdruntime/libgdruntime.la
libgphobos_la_DEPENDENCIES = libgphobos.spec
import std.math;
assert(cos(complex(0.0)) == 1.0);
assert(cos(complex(1.3L)) == std.math.cos(1.3L));
- assert(cos(complex(0, 5.2L)) == cosh(5.2L));
+ auto c1 = cos(complex(0, 5.2L));
+ auto c2 = cosh(5.2L);
+ assert(feqrel(c1.re, c2.re) >= real.mant_dig - 1 &&
+ feqrel(c1.im, c2.im) >= real.mant_dig - 1);
}
{
private enum bool haveSSE = true;
}
-else
+else version (X86)
{
static import core.cpuid;
private alias haveSSE = core.cpuid.sse;
-9.889929415807650724957118893791829849557E-1L
];
static immutable real[7] Q = [
- 8.650244186622719093893836740197250197602E10L
+ 8.650244186622719093893836740197250197602E10L,
-4.152206921457208101480801635640958361612E10L,
2.758476078803232151774723646710890525496E9L,
-5.733709132766856723608447733926138506824E7L,
@safe pure nothrow @nogc unittest
{
- static if (floatTraits!(real).realFormat == RealFormat.ieeeExtended)
+ static if (floatTraits!(real).realFormat == RealFormat.ieeeExtended ||
+ floatTraits!(real).realFormat == RealFormat.ieeeQuadruple)
{
assert(ldexp(1.0L, -16384) == 0x1p-16384L);
assert(ldexp(1.0L, -16382) == 0x1p-16382L);
const j = sign ? -OF : OF;
x = (j + x) - j;
+ const exp = (vu[F.EXPPOS_SHORT] & F.EXPMASK) - (F.EXPBIAS + 1);
const implicitOne = 1UL << 48;
auto vl = cast(ulong*)(&x);
vl[MANTISSA_MSB] &= implicitOne - 1;
long result;
- const exp = (vu[F.EXPPOS_SHORT] & F.EXPMASK) - (F.EXPBIAS + 1);
if (exp < 0)
result = 0;
else if (exp <= 48)
}
else version (AArch64)
{
+ ControlState cont;
asm pure nothrow @nogc
{
"mrs %0, FPCR;" : "=r" cont;
{
pragma(msg, "test disabled on ARM, see bug 5628");
}
+ else version (GNU)
+ {
+ pragma(msg, "test disabled on GNU, see bug 5628");
+ }
else
{
assert(pow(xd, neg2) == 1 / (x * x));
// Generate a uniformly-distributed integer in the range [0, 14]
// If no random generator is passed, the global `rndGen` would be used
auto i = uniform(0, 15, rnd);
- assert(i == 12);
+ assert(i >= 0 && i < 15);
// Generate a uniformly-distributed real in the range [0, 100)
auto r = uniform(0.0L, 100.0L, rnd);
- assert(r == 79.65429843861011285);
+ assert(r >= 0 && r < 100);
// Generate a 32-bit random number
auto u = uniform!uint(rnd);
- assert(u == 4083286876);
+ static assert(is(typeof(u) == uint));
}
version (unittest)
DCFG_MINFO_BRACKETING = @DCFG_MINFO_BRACKETING@
DCFG_THREAD_MODEL = @DCFG_THREAD_MODEL@
DEFS = @DEFS@
-DRUNTIME_SOVERSION = @DRUNTIME_SOVERSION@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-PHOBOS_SOVERSION = @PHOBOS_SOVERSION@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
libphobos_srcdir = @libphobos_srcdir@
libphobos_toolexecdir = @libphobos_toolexecdir@
libphobos_toolexeclibdir = @libphobos_toolexeclibdir@
+libtool_VERSION = @libtool_VERSION@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@