Skip to content

Fix stack allocation tests on 32 bit #1017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ocaml/testsuite/tests/typing-local/loop_regions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*)

external local_stack_offset : unit -> int = "caml_local_stack_offset"
let local_stack_offset () = local_stack_offset () / (Sys.word_size / 8)
external opaque_local : ('a[@local_opt]) -> ('a[@local_opt]) = "%opaque"

let print_offsets (name,allocs) =
Expand Down
12 changes: 6 additions & 6 deletions ocaml/testsuite/tests/typing-local/loop_regions.stack.reference
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local for: [0; 16; 16]
non-local for: [0; 16; 0]
local while body: [0; 16; 16]
nonlocal while body: [0; 16; 0]
local while cond: [0; 16; 16]
nonlocal while cond: [0; 16; 0]
local for: [0; 2; 2]
non-local for: [0; 2; 0]
local while body: [0; 2; 2]
nonlocal while body: [0; 2; 0]
local while cond: [0; 2; 2]
nonlocal while cond: [0; 2; 0]
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/typing-local/pr902.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ let () =
let p = to_be_overapplied () () () 42 () in
let end_offset = local_stack_offset () in
assert (is_local p);
let ok = end_offset - start_offset = 64 in
let ok = end_offset - start_offset = Sys.word_size (* eight words *) in
Printf.printf "PR902: %s\n" (if ok then "ok" else "FAIL")