ocaml: phase 6 Sys module constants (+5 tests, 414 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 26s

os_type="SX", word_size=64, max_array_length, max_string_length,
executable_name="ocaml-on-sx", big_endian=false, unix=true,
win32=false, cygwin=false. Constants-only for now — argv/getenv_opt/
command would need host platform integration.
This commit is contained in:
2026-05-08 15:46:33 +00:00
parent 4bca2cacff
commit cd93b11328
3 changed files with 39 additions and 0 deletions

View File

@@ -366,6 +366,18 @@
let printf fmt = print_string fmt
end ;;
module Sys = struct
let os_type = \"SX\"
let word_size = 64
let max_array_length = 4611686018427387903
let max_string_length = 4611686018427387903
let executable_name = \"ocaml-on-sx\"
let big_endian = false
let unix = true
let win32 = false
let cygwin = false
end ;;
module Hashtbl = struct
let create n = _hashtbl_create n
let add t k v = _hashtbl_add t k v

View File

@@ -1012,6 +1012,18 @@ cat > "$TMPFILE" << 'EPOCHS'
(epoch 3102)
(eval "(ocaml-type-of-program \"type t = A of bool | B of float;; A true\")")
;; ── Sys module stubs ──────────────────────────────────────────
(epoch 3200)
(eval "(ocaml-run \"Sys.os_type\")")
(epoch 3201)
(eval "(ocaml-run \"Sys.word_size\")")
(epoch 3202)
(eval "(ocaml-run \"Sys.unix\")")
(epoch 3203)
(eval "(ocaml-run \"Sys.win32\")")
(epoch 3204)
(eval "(ocaml-run \"Sys.executable_name\")")
EPOCHS
OUTPUT=$(timeout 180 "$SX_SERVER" < "$TMPFILE" 2>/dev/null)
@@ -1601,6 +1613,13 @@ check 3100 "shape -> Int" '"shape -> Int"'
check 3101 "TStr 'hi' : tag" '"tag"'
check 3102 "A true : t" '"t"'
# ── Sys stubs ──────────────────────────────────────────────────
check 3200 "Sys.os_type" '"SX"'
check 3201 "Sys.word_size" '64'
check 3202 "Sys.unix" 'true'
check 3203 "Sys.win32" 'false'
check 3204 "Sys.executable_name" '"ocaml-on-sx"'
TOTAL=$((PASS + FAIL))
if [ $FAIL -eq 0 ]; then
echo "ok $PASS/$TOTAL OCaml-on-SX tests passed"