File tree Expand file tree Collapse file tree 9 files changed +78
-9
lines changed Expand file tree Collapse file tree 9 files changed +78
-9
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,12 @@ let allocated_bytes () =
97
97
98
98
99
99
external finalise : ('a -> unit ) -> 'a -> unit = " caml_final_register"
100
+ #if BS then
101
+ let finalise_last = fun _ _ : unit -> ()
102
+ #else
100
103
external finalise_last : (unit -> unit ) -> 'a -> unit =
101
104
" caml_final_register_called_without_value"
105
+ #end
102
106
external finalise_release : unit -> unit = " caml_final_release"
103
107
104
108
Original file line number Diff line number Diff line change @@ -56,10 +56,13 @@ let flip_ongoing_traversal h =
56
56
(* To pick random seeds if requested *)
57
57
58
58
let randomized_default =
59
- let params =
59
+ #if BS then false
60
+ #else
61
+ let params =
60
62
try Sys. getenv " OCAMLRUNPARAM" with Not_found ->
61
63
try Sys. getenv " CAMLRUNPARAM" with Not_found -> " " in
62
64
String. contains params 'R'
65
+ #end
63
66
64
67
let randomized = ref randomized_default
65
68
Original file line number Diff line number Diff line change @@ -28,9 +28,15 @@ external size : t -> int = "%obj_size"
28
28
external reachable_words : t -> int = " caml_obj_reachable_words"
29
29
external field : t -> int -> t = " %obj_field"
30
30
external set_field : t -> int -> t -> unit = " %obj_set_field"
31
+ #if BS then
32
+ external floatarray_get : floatarray -> int -> float = " %array_safe_get"
33
+ external floatarray_set :
34
+ floatarray -> int -> float -> unit = " %array_safe_set"
35
+ #else
31
36
external floatarray_get : floatarray -> int -> float = " caml_floatarray_get"
32
37
external floatarray_set :
33
38
floatarray -> int -> float -> unit = " caml_floatarray_set"
39
+ #end
34
40
let [@ inline always] double_field x i = floatarray_get (obj x : floatarray ) i
35
41
let [@ inline always] set_double_field x i v =
36
42
floatarray_set (obj x : floatarray ) i v
@@ -93,7 +99,7 @@ module Ephemeron = struct
93
99
94
100
external create : int -> t = " caml_ephe_create"
95
101
96
- let length x = size(repr x) - 2
102
+ let length x = size(repr x) - 2 (* -FIXME *)
97
103
98
104
external get_key : t -> int -> obj_t option = " caml_ephe_get_key"
99
105
external get_key_copy : t -> int -> obj_t option = " caml_ephe_get_key_copy"
Original file line number Diff line number Diff line change 11
11
(* special exception on linking described in the file LICENSE. *)
12
12
(* *)
13
13
(* *************************************************************************)
14
-
14
+ #if BS then
15
+ let spacetime_enabled : unit -> bool = fun _ -> false
16
+ let enabled = false
17
+ #else
15
18
external spacetime_enabled : unit -> bool
16
19
= " caml_spacetime_enabled" [@@ noalloc]
17
20
18
21
let enabled = spacetime_enabled ()
19
-
22
+ #end
20
23
let if_spacetime_enabled f =
21
24
if enabled then f () else ()
22
25
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ module B = Bytes
36
36
37
37
let bts = B. unsafe_to_string
38
38
let bos = B. unsafe_of_string
39
-
39
+ (* -FIXME: replaced by Belt.String.repeat *)
40
40
let make n c =
41
41
B. make n c |> bts
42
42
let init n f =
Original file line number Diff line number Diff line change @@ -129,12 +129,15 @@ let catch_break on =
129
129
else
130
130
set_signal sigint Signal_default
131
131
132
-
132
+ #if BS then
133
+ let enable_runtime_warnings : bool -> unit = fun _ -> ()
134
+ let runtime_warnings_enabled : unit -> bool = fun _ -> false
135
+ #else
133
136
external enable_runtime_warnings : bool -> unit =
134
137
" caml_ml_enable_runtime_warnings"
135
138
external runtime_warnings_enabled : unit -> bool =
136
139
" caml_ml_runtime_warnings_enabled"
137
-
140
+ #end
138
141
(* The version string is found in file ../VERSION *)
139
142
140
143
let ocaml_version = " 4.06.2+BS"
Original file line number Diff line number Diff line change @@ -105,7 +105,43 @@ let f8 = function
105
105
| T65 _ -> 2
106
106
| _ -> 3
107
107
108
-
108
+ (*
109
+ ocaml402
110
+ {[
111
+ (function param/1098
112
+ (catch
113
+ (catch
114
+ (catch
115
+ (switch param/1098
116
+ case int 0: (exit 11)
117
+ case int 1: (exit 11)
118
+ case int 2: (exit 11)
119
+ case tag 0: (exit 12)
120
+ case tag 1: (exit 12)
121
+ default: (exit 13))
122
+ with (13) 3)
123
+ with (11) 1)
124
+ with (12) 2))
125
+ ]}
126
+
127
+ ocaml406
128
+ {[
129
+ (function param/1069
130
+ (catch
131
+ (catch
132
+ (switch param/1069
133
+ case int 3: (exit 10)
134
+ case tag 0: (exit 9)
135
+ case tag 1: (exit 9)
136
+ case tag 2: (exit 10)
137
+ case tag 3: (exit 10)
138
+ default: 1)
139
+ with (10) 3)
140
+ with (9) 2))
141
+ ]}
142
+
143
+
144
+ *)
109
145
let f9 = function
110
146
| T60
111
147
| T61
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ let u = B
9
9
exception D of int
10
10
11
11
let d = D 3
12
- #if OCAML_VERSION =~ " <4.03.0 " then (* Not allowed *)
12
+ #if 0 then (* Not allowed *)
13
13
exception A of int
14
14
(* intentionally overridden ,
15
15
so that we can not tell the differrence, only by [id]*)
Original file line number Diff line number Diff line change
1
+ let suites : Mt.pair_suites ref = ref []
2
+ let test_id = ref 0
3
+ let eq loc x y = Mt. eq_suites ~test_id ~suites loc x y
4
+
5
+
1
6
module rec Int32 : sig
2
7
type t
3
8
type buffer
@@ -14,3 +19,12 @@ module rec Int3 : sig
14
19
end = Int3
15
20
16
21
22
+
23
+ (* expect raise Undefined_recursive_module *)
24
+ ;; eq __LOC__ 4
25
+ (try ignore (Int3. u 3 ); 3
26
+ with Undefined_recursive_module _ -> 4 )
27
+
28
+
29
+ let () =
30
+ Mt. from_pair_suites __FILE__ ! suites
You can’t perform that action at this time.
0 commit comments