mirror of
https://github.com/dlang/phobos.git
synced 2025-05-10 22:18:03 +03:00
math.d: disable inline asm tests if unsupported
This commit is contained in:
parent
c75d29af52
commit
f95f81af9c
1 changed files with 62 additions and 50 deletions
22
std/math.d
22
std/math.d
|
@ -2322,7 +2322,7 @@ private T expImpl(T)(T x) @safe pure nothrow @nogc
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
@safe @nogc nothrow unittest
|
version (InlineAsm_X86_Any) @safe @nogc nothrow unittest
|
||||||
{
|
{
|
||||||
FloatingPointControl ctrl;
|
FloatingPointControl ctrl;
|
||||||
if (FloatingPointControl.hasExceptionTraps)
|
if (FloatingPointControl.hasExceptionTraps)
|
||||||
|
@ -5099,6 +5099,8 @@ float rint(float x) @safe pure nothrow @nogc { return rint(cast(real) x); }
|
||||||
|
|
||||||
///
|
///
|
||||||
@safe unittest
|
@safe unittest
|
||||||
|
{
|
||||||
|
version (InlineAsm_X86_Any)
|
||||||
{
|
{
|
||||||
resetIeeeFlags();
|
resetIeeeFlags();
|
||||||
assert(rint(0.4) == 0);
|
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);
|
||||||
assert(rint(-real.infinity) == -real.infinity);
|
assert(rint(-real.infinity) == -real.infinity);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@safe unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
|
@ -5672,6 +5675,8 @@ public:
|
||||||
|
|
||||||
///
|
///
|
||||||
@safe unittest
|
@safe unittest
|
||||||
|
{
|
||||||
|
version (InlineAsm_X86_Any)
|
||||||
{
|
{
|
||||||
static void func() {
|
static void func() {
|
||||||
int a = 10 * 10;
|
int a = 10 * 10;
|
||||||
|
@ -5696,8 +5701,9 @@ public:
|
||||||
func();
|
func();
|
||||||
assert(ieeeFlags == f);
|
assert(ieeeFlags == f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@safe unittest
|
version (InlineAsm_X86_Any) @safe unittest
|
||||||
{
|
{
|
||||||
import std.meta : AliasSeq;
|
import std.meta : AliasSeq;
|
||||||
|
|
||||||
|
@ -5772,6 +5778,8 @@ void resetIeeeFlags() @trusted nothrow @nogc
|
||||||
|
|
||||||
///
|
///
|
||||||
@safe unittest
|
@safe unittest
|
||||||
|
{
|
||||||
|
version (InlineAsm_X86_Any)
|
||||||
{
|
{
|
||||||
resetIeeeFlags();
|
resetIeeeFlags();
|
||||||
real a = 3.5;
|
real a = 3.5;
|
||||||
|
@ -5782,6 +5790,7 @@ void resetIeeeFlags() @trusted nothrow @nogc
|
||||||
resetIeeeFlags();
|
resetIeeeFlags();
|
||||||
assert(!ieeeFlags.divByZero);
|
assert(!ieeeFlags.divByZero);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns: snapshot of the current state of the floating-point status flags
|
/// Returns: snapshot of the current state of the floating-point status flags
|
||||||
@property IeeeFlags ieeeFlags() @trusted pure nothrow @nogc
|
@property IeeeFlags ieeeFlags() @trusted pure nothrow @nogc
|
||||||
|
@ -5791,6 +5800,8 @@ void resetIeeeFlags() @trusted nothrow @nogc
|
||||||
|
|
||||||
///
|
///
|
||||||
@safe nothrow unittest
|
@safe nothrow unittest
|
||||||
|
{
|
||||||
|
version (InlineAsm_X86_Any)
|
||||||
{
|
{
|
||||||
resetIeeeFlags();
|
resetIeeeFlags();
|
||||||
real a = 3.5;
|
real a = 3.5;
|
||||||
|
@ -5803,6 +5814,7 @@ void resetIeeeFlags() @trusted nothrow @nogc
|
||||||
assert(isNaN(a));
|
assert(isNaN(a));
|
||||||
assert(ieeeFlags.invalid);
|
assert(ieeeFlags.invalid);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Control the Floating point hardware
|
/** Control the Floating point hardware
|
||||||
|
|
||||||
|
@ -6249,7 +6261,7 @@ private:
|
||||||
///
|
///
|
||||||
@safe unittest
|
@safe unittest
|
||||||
{
|
{
|
||||||
version (D_HardFloat)
|
version (InlineAsm_X86_Any)
|
||||||
{
|
{
|
||||||
FloatingPointControl fpctrl;
|
FloatingPointControl fpctrl;
|
||||||
|
|
||||||
|
@ -6264,7 +6276,7 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version (D_HardFloat) @safe unittest
|
version (InlineAsm_X86_Any) @safe unittest
|
||||||
{
|
{
|
||||||
void ensureDefaults()
|
void ensureDefaults()
|
||||||
{
|
{
|
||||||
|
@ -6301,7 +6313,7 @@ version (D_HardFloat) @safe unittest
|
||||||
ensureDefaults();
|
ensureDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
version (D_HardFloat) @safe unittest // rounding
|
version (InlineAsm_X86_Any) @safe unittest // rounding
|
||||||
{
|
{
|
||||||
import std.meta : AliasSeq;
|
import std.meta : AliasSeq;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue