Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 847e201

Browse files
committed
runnable/test22.d: Support 64-bit reals for x86 and x86_64
1 parent 14ff752 commit 847e201

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

runnable/test22.d

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ extern(C)
1515
int snprintf(char*, size_t, const char*, ...);
1616
}
1717

18+
version (LDC) static if (real.mant_dig != 64)
19+
version = LDC_NoX87;
20+
1821
/*************************************/
1922

2023
// http://www.digitalmars.com/d/archives/digitalmars/D/bugs/4766.html
@@ -237,7 +240,8 @@ void assertEqual(real* a, real* b, string file = __FILE__, size_t line = __LINE_
237240

238241
// Only compare the 10 value bytes, the padding bytes are of undefined
239242
// value.
240-
version (X86) enum count = 10;
243+
version (LDC_NoX87) enum count = real.sizeof;
244+
else version (X86) enum count = 10;
241245
else version (X86_64) enum count = 10;
242246
else enum count = real.sizeof;
243247
for (size_t i = 0; i < count; i++)
@@ -922,7 +926,11 @@ in
922926
}
923927
body
924928
{
925-
version (D_InlineAsm_X86)
929+
version (LDC_NoX87)
930+
{
931+
return 0;
932+
}
933+
else version (D_InlineAsm_X86)
926934
{
927935
version (linux)
928936
{
@@ -1078,6 +1086,7 @@ void test47()
10781086

10791087
r = (56.1L + (32.7L + 6L * x) * x);
10801088
assert(r == poly_c(x, pp));
1089+
version (LDC_NoX87) {} else
10811090
version (D_InlineAsm_X86)
10821091
assert(r == poly_asm(x, pp));
10831092
assert(r == poly(x, pp));

0 commit comments

Comments
 (0)