blob: e5a47342a2beefc24e31994a27c37bd737b33924 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
(* TEST
include tool-ocaml-lib
flags = "-w -a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
let s = Bytes.of_string "abcdefgh" in
Bytes.unsafe_fill s 0 6 'x';
if Bytes.get s 5 <> 'x' then raise Not_found
;;
(**
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7 SETGLOBAL Lib
9 GETGLOBAL "abcdefgh"
11 PUSHCONSTINT 120
13 PUSHCONSTINT 6
15 PUSHCONST0
16 PUSHACC3
17 C_CALL4 fill_string
19 CONSTINT 120
21 PUSHCONSTINT 5
23 PUSHACC2
24 GETSTRINGCHAR
25 NEQ
26 BRANCHIFNOT 33
28 GETGLOBAL Not_found
30 MAKEBLOCK1 0
32 RAISE
33 POP 1
35 ATOM0
36 SETGLOBAL T240-c_call4
38 STOP
**)
|