Skip to content

Commit

Permalink
Add test for ocaml#637 regression
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed Mar 21, 2018
1 parent 71e20eb commit 79ee203
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
51 changes: 51 additions & 0 deletions test/unit-tests/ocaml-config/gh637.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
open Stdune

let valid_ocaml_config =
{|version: 4.02.3
standard_library_default: /usr/lib/ocaml
standard_library: /usr/lib/ocaml
standard_runtime: /usr/bin/ocamlrun
ccomp_type: cc
bytecomp_c_compiler: gcc -O -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O -fPIC
bytecomp_c_libraries: -lm -ldl -lcurses -lpthread
native_c_compiler: gcc -O -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT
native_c_libraries: -lm -ldl
native_pack_linker: ld -r -o
ranlib: ranlib
cc_profile: -pg
architecture: none
model: default
system: unknown
asm:
asm_cfi_supported: false
with_frame_pointers: false
ext_obj: .o
ext_asm: .s
ext_lib: .a
ext_dll: .so
os_type: Unix
default_executable_name: a.out
systhread_supported: true
host: mips-unknown-linux-gnu
target: mips-unknown-linux-gnu
exec_magic_number: Caml1999X011
cmi_magic_number: Caml1999I017
cmo_magic_number: Caml1999O010
cma_magic_number: Caml1999A011
cmx_magic_number: Caml1999Y014
cmxa_magic_number: Caml1999Z013
ast_impl_magic_number: Caml1999M016
ast_intf_magic_number: Caml1999N015
cmxs_magic_number: Caml2007D002
cmt_magic_number: Caml2012T004|}

let () =
let open Result.O in
match
valid_ocaml_config
|> String.split_lines
|> Ocaml_config.Vars.of_lines
>>= Ocaml_config.make
with
| Error e -> failwith e
| Ok (_ : Ocaml_config.t) -> ()
10 changes: 10 additions & 0 deletions test/unit-tests/ocaml-config/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(jbuild_version 1)

(executable
((name gh637)
(libraries (ocaml_config))))

(alias
((name runtest)
(deps (./gh637.exe))
(action (run ${<}))))

0 comments on commit 79ee203

Please sign in to comment.