diff options
| author | Brian Campbell | 2017-09-04 12:09:59 +0100 |
|---|---|---|
| committer | Brian Campbell | 2017-09-04 12:09:59 +0100 |
| commit | 00cf8533221d2dfa650adcd38ac53943be5bd995 (patch) | |
| tree | 21a34e1f094ecec430798020e046dd3374e6e74c /test/ocaml/hello_world | |
| parent | 461f3c914b2e767ef3ddb926712845d5442475f3 (diff) | |
| parent | de506ed9f9c290796f159f2b5279589519c2a198 (diff) | |
Merge branch 'experiments' of bitbucket.org:Peter_Sewell/sail into mono-experiments
Diffstat (limited to 'test/ocaml/hello_world')
| -rw-r--r-- | test/ocaml/hello_world/expect | 2 | ||||
| -rw-r--r-- | test/ocaml/hello_world/hello_world.sail | 19 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/ocaml/hello_world/expect b/test/ocaml/hello_world/expect new file mode 100644 index 00000000..3df47a31 --- /dev/null +++ b/test/ocaml/hello_world/expect @@ -0,0 +1,2 @@ +Hello, Sail! +Hello, World! diff --git a/test/ocaml/hello_world/hello_world.sail b/test/ocaml/hello_world/hello_world.sail new file mode 100644 index 00000000..d96429f2 --- /dev/null +++ b/test/ocaml/hello_world/hello_world.sail @@ -0,0 +1,19 @@ + +val unit -> string effect pure hello_world + +function hello_world () = { + return "Hello, World!"; + "Unreachable" +} + +val unit -> unit effect {wreg, rreg} main + +register string REG + +function main () = { + REG := "Hello, Sail!"; + print(REG); + REG := hello_world (); + print(REG); + return () +} |
