math.d: disable inline asm tests if unsupported

This commit is contained in:
Eugen Wissner 2019-05-06 07:23:19 +02:00
parent c75d29af52
commit f95f81af9c

View file

@ -2322,7 +2322,7 @@ private T expImpl(T)(T x) @safe pure nothrow @nogc
return x;
}
@safe @nogc nothrow unittest
version (InlineAsm_X86_Any) @safe @nogc nothrow unittest
{
FloatingPointControl ctrl;
if (FloatingPointControl.hasExceptionTraps)
@ -5099,6 +5099,8 @@ float rint(float x) @safe pure nothrow @nogc { return rint(cast(real) x); }
///
@safe unittest
{
version (InlineAsm_X86_Any)
{
resetIeeeFlags();
assert(rint(0.4) == 0);
@ -5112,6 +5114,7 @@ float rint(float x) @safe pure nothrow @nogc { return rint(cast(real) x); }
assert(rint(real.infinity) == real.infinity);
assert(rint(-real.infinity) == -real.infinity);
}
}
@safe unittest
{
@ -5672,6 +5675,8 @@ public:
///
@safe unittest
{
version (InlineAsm_X86_Any)
{
static void func() {
int a = 10 * 10;
@ -5696,8 +5701,9 @@ public:
func();
assert(ieeeFlags == f);
}
}
@safe unittest
version (InlineAsm_X86_Any) @safe unittest
{
import std.meta : AliasSeq;
@ -5772,6 +5778,8 @@ void resetIeeeFlags() @trusted nothrow @nogc
///
@safe unittest
{
version (InlineAsm_X86_Any)
{
resetIeeeFlags();
real a = 3.5;
@ -5782,6 +5790,7 @@ void resetIeeeFlags() @trusted nothrow @nogc
resetIeeeFlags();
assert(!ieeeFlags.divByZero);
}
}
/// Returns: snapshot of the current state of the floating-point status flags
@property IeeeFlags ieeeFlags() @trusted pure nothrow @nogc
@ -5791,6 +5800,8 @@ void resetIeeeFlags() @trusted nothrow @nogc
///
@safe nothrow unittest
{
version (InlineAsm_X86_Any)
{
resetIeeeFlags();
real a = 3.5;
@ -5803,6 +5814,7 @@ void resetIeeeFlags() @trusted nothrow @nogc
assert(isNaN(a));
assert(ieeeFlags.invalid);
}
}
/** Control the Floating point hardware
@ -6249,7 +6261,7 @@ private:
///
@safe unittest
{
version (D_HardFloat)
version (InlineAsm_X86_Any)
{
FloatingPointControl fpctrl;
@ -6264,7 +6276,7 @@ private:
}
}
version (D_HardFloat) @safe unittest
version (InlineAsm_X86_Any) @safe unittest
{
void ensureDefaults()
{
@ -6301,7 +6313,7 @@ version (D_HardFloat) @safe unittest
ensureDefaults();
}
version (D_HardFloat) @safe unittest // rounding
version (InlineAsm_X86_Any) @safe unittest // rounding
{
import std.meta : AliasSeq;