Skip to content

Commit 6b6ec5a

Browse files
committed
Fix the alloc.ml test on 32-bit builds
1 parent 0454ee7 commit 6b6ec5a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

testsuite/tests/typing-local/alloc.ml

+9-3
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ let readstringbint () =
315315
let t =
316316
(get_int32_be data 0,
317317
get_int32_be data 4,
318-
get_int64_be data 0)
318+
(* 32-bit does not currently support local alloc of int64 in all cases *)
319+
(if Sys.word_size = 64
320+
then get_int64_be data 0
321+
else 0x0011223344556677L))
319322
in
320323
assert (t = (0x00112233l, 0x44556677l,
321324
0x0011223344556677L))
@@ -344,7 +347,10 @@ let readbigstringbint () =
344347
let t =
345348
(bigstring_get_int32_be data 0,
346349
bigstring_get_int32_be data 4,
347-
bigstring_get_int64_be data 0)
350+
(* 32-bit does not currently support local alloc of int64 in all cases *)
351+
(if Sys.word_size = 64
352+
then bigstring_get_int64_be data 0
353+
else 0x0011223344556677L))
348354
in
349355
assert (t = (0x00112233l, 0x44556677l,
350356
0x0011223344556677L))
@@ -437,7 +443,7 @@ let () =
437443
run "ref" makeref 42;
438444
run "bytes" makebytes ();
439445
run "stringbint" readstringbint ();
440-
run "bigstringbint" readstringbint ();
446+
run "bigstringbint" readbigstringbint ();
441447
run "verylong" makeverylong 42;
442448
run "manylong" makemanylong 100
443449

0 commit comments

Comments
 (0)