Skip to content

Commit

Permalink
Fix tests ocaml#3
Browse files Browse the repository at this point in the history
  • Loading branch information
jfehrle committed Aug 4, 2020
1 parent 5d554df commit a3bf2b0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions runtime/gc_ctrl.c
Expand Up @@ -368,8 +368,8 @@ CAMLprim value caml_gc_field_path (value sym)
CAMLparam1 (sym);
CAMLlocal1 (res);

const int max = 2;
int items[max];
int items[2];
const int max = sizeof(items)/sizeof(int);

int rem_depth = caml_do_field_path(sym, items, max);
value rv_len = rem_depth >= 0 ? 1 + max - rem_depth : 0;
Expand Down
14 changes: 7 additions & 7 deletions testsuite/tests/lib-reachable/testopt.ml
Expand Up @@ -22,13 +22,13 @@ all_modules = "testopt.ml"
*)
let _ =
let test_src_dir = Sys.getenv("test_source_directory") in
let flambda = Sys.getenv("CONFIG_ARG") = "--enable-flambda" with Not_found -> false in
let src = match Sys.unix, Sys.word_size, flambda with
| _, _, true -> "testoptflambda.reference"
| true, 64, _ -> "testopt64.reference"
| true, 32, _ -> "testopt32.reference"
| false, _ , _ -> "testwin.reference"
| _, _ -> ""
let flambda = try Sys.getenv("CONFIG_ARG") = "--enable-flambda" with Not_found -> false in
let src = match flambda, Sys.unix, Sys.word_size with
| true, _, _ -> "testoptflambda.reference"
| _, true, 64 -> "testopt64.reference"
| _, true, 32 -> "testopt32.reference"
| _, false, _ -> "testwin.reference"
| _, _, _ -> ""
in
let reference = Sys.getenv("reference") in
Sys.command (Printf.sprintf "cp %s/%s %s" test_src_dir src reference)
Expand Down
18 changes: 9 additions & 9 deletions testsuite/tests/lib-reachable/testopt32.reference
@@ -1,12 +1,12 @@
Field path of x = 0
Field path of y = 1
Field path of Foo.junk = 2 0
Field path of Foo.junk2 = 2 1
Field path of u = 2
Field path of v = 3
Field path of Foo.junk = 4 0
Field path of Foo.junk2 = 4 1
Globals:
101 field 0 camlTestopt__gc_roots
201 field 1 camlTestopt__gc_roots
101 field 2 camlTestopt__gc_roots
201 field 3 camlTestopt__gc_roots

Called from Testopt.g in file "testopt.ml", line 74, characters 2-6
2001 field 0 (frame 0)
3001 field 1 (frame 0)
Called from Testopt.g in file "testopt.ml", line 79, characters 2-6
3001 field 0 (frame 0)
2001 field 1 (frame 0)
1001 field 2 (frame 0)
2 changes: 1 addition & 1 deletion testsuite/tests/lib-reachable/testopt64.reference
Expand Up @@ -6,7 +6,7 @@ Globals:
101 field 2 camlTestopt__gc_roots
201 field 3 camlTestopt__gc_roots

Called from Testopt.g in file "testopt.ml", line 78, characters 2-6
Called from Testopt.g in file "testopt.ml", line 79, characters 2-6
3001 field 0 (frame 0)
2001 field 1 (frame 0)
1001 field 2 (frame 0)

0 comments on commit a3bf2b0

Please sign in to comment.