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

Commit 9c840a1

Browse files
committed
Merge pull request #14 from kinke/misc
Misc. fixes/workarounds for MSVC targets
2 parents 397661c + 847e201 commit 9c840a1

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,11 @@ DISABLED_TESTS += testclass
225225
DISABLED_SH_TESTS += test_shared
226226

227227
# LDC: OS X ld needs extra options, but not needed so do not bother
228+
# not supported for MSVC either
228229
ifeq ($(OS),osx)
229230
DISABLED_TESTS += ldc_extern_weak
230231
endif
231-
ifeq ($(OS),win64)
232+
ifeq ($(findstring win,$(OS)),win)
232233
DISABLED_TESTS += ldc_extern_weak
233234
endif
234235

runnable/mars1.d

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -794,23 +794,26 @@ struct S8658
794794
int[16385] a;
795795
}
796796

797+
// LDC_FIXME: The LLVM x86 backend suffers from this as well - an
798+
// argument's size in bytes seems to be limited to 16 bits.
799+
version (LDC) version (X86) version = LDC_X86;
800+
801+
version (LDC_X86) {} else
802+
{
797803
void foo8658(S8658 s)
798804
{
799805
int x;
800806
}
807+
}
801808

802809
void test8658()
803810
{
804811
S8658 s;
805-
version (LDC)
806-
{
807-
// LDC_FIXME: The LLVM x86 backend suffers from this as well.
808-
}
809-
else
810-
{
812+
version (LDC_X86) {} else
813+
{
811814
for(int i = 0; i < 1000; i++)
812815
foo8658(s);
813-
}
816+
}
814817
}
815818

816819
////////////////////////////////////////////////////////////////////////

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)