Skip to content

Commit 41cc142

Browse files
committed
tests: fix i386 run failures
inferred-double asserts SizeOf 10 on 32-bit (default real type there is Extended); multi_var_init compares 3.5 which is exact in binary, 3.14 broke on x87 where the literal is evaluated as 80-bit Extended; match_dispatching_calls renamed - a 32-bit exe with "patch" in its name trips the Windows installer-detection UAC heuristic (error 740)
1 parent 5eab3da commit 41cc142

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

unleashed/tests/testfiles/inline_vars/inline_vars_inferred_double_01.pp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
var pi := 3.14;
77
if pi < 3.13 then halt(1);
88
if pi > 3.15 then halt(2);
9-
if SizeOf(pi) <> SizeOf(Double) then halt(3);
9+
// float literals infer the platform default real type: Double on 64-bit,
10+
// Extended (10 bytes) on i386
11+
{$ifdef CPU64}
12+
if SizeOf(pi) <> 8 then halt(3);
13+
{$else}
14+
if SizeOf(pi) <> 10 then halt(3);
15+
{$endif}
1016
end.

unleashed/tests/testfiles/match/match_dispatching_calls_01.pp renamed to unleashed/tests/testfiles/match/match_proc_calls_01.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
program match_dispatching_calls_01;
1+
program match_proc_calls_01;
22

33
{$mode unleashed}
44

unleashed/tests/testfiles/multi_var_init/multi_var_init_double_01.pp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
{$mode unleashed}
44

5+
// 3.5 is exact in binary, so the compares stay precision-safe on i386
6+
// where the literal is evaluated as 80-bit Extended
57
var
6-
x, y, z: Double = 3.14;
8+
x, y, z: Double = 3.5;
79

810
begin
9-
if x <> 3.14 then halt(1);
10-
if y <> 3.14 then halt(2);
11-
if z <> 3.14 then halt(3);
11+
if x <> 3.5 then halt(1);
12+
if y <> 3.5 then halt(2);
13+
if z <> 3.5 then halt(3);
1214
x := 0;
13-
if y <> 3.14 then halt(4);
14-
if z <> 3.14 then halt(5);
15+
if y <> 3.5 then halt(4);
16+
if z <> 3.5 then halt(5);
1517
end.

0 commit comments

Comments
 (0)