diff options
| author | Alasdair Armstrong | 2018-08-20 15:30:29 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-08-20 15:30:29 +0100 |
| commit | 1d7b5f0ddaa6b80babc34180fee5fb4f191283e4 (patch) | |
| tree | 87bfeb74d91651591d36dd81efbe44dce6cb87b7 /test | |
| parent | 3414ffbc4d62f5cb019def6a6e9931319ac1ffa7 (diff) | |
Add some more test cases for C compilation
Test that basic bi-directional mappings compile correctly
Test that a minimal file importing the prelude compiles correctly
Diffstat (limited to 'test')
| -rw-r--r-- | test/c/mapping.expect | 1 | ||||
| -rw-r--r-- | test/c/mapping.sail | 17 | ||||
| -rw-r--r-- | test/c/prelude.expect | 0 | ||||
| -rw-r--r-- | test/c/prelude.sail | 7 |
4 files changed, 25 insertions, 0 deletions
diff --git a/test/c/mapping.expect b/test/c/mapping.expect new file mode 100644 index 00000000..49f4aaa8 --- /dev/null +++ b/test/c/mapping.expect @@ -0,0 +1 @@ +m() = 1 diff --git a/test/c/mapping.sail b/test/c/mapping.sail new file mode 100644 index 00000000..3d232a42 --- /dev/null +++ b/test/c/mapping.sail @@ -0,0 +1,17 @@ +default Order dec + +$include <flow.sail> +$include <arith.sail> + +val m : unit <-> int(1) + +mapping m = { + () <-> 1 +} + +val main : unit -> unit + +function main() = { + print_int("m() = ", m()); + m(1) +}
\ No newline at end of file diff --git a/test/c/prelude.expect b/test/c/prelude.expect new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/c/prelude.expect diff --git a/test/c/prelude.sail b/test/c/prelude.sail new file mode 100644 index 00000000..7e217f5d --- /dev/null +++ b/test/c/prelude.sail @@ -0,0 +1,7 @@ +default Order dec + +$include <prelude.sail> + +val main : unit -> unit + +function main() = () |
