From 1d7b5f0ddaa6b80babc34180fee5fb4f191283e4 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Mon, 20 Aug 2018 15:30:29 +0100 Subject: 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 --- test/c/mapping.expect | 1 + test/c/mapping.sail | 17 +++++++++++++++++ test/c/prelude.expect | 0 test/c/prelude.sail | 7 +++++++ 4 files changed, 25 insertions(+) create mode 100644 test/c/mapping.expect create mode 100644 test/c/mapping.sail create mode 100644 test/c/prelude.expect create mode 100644 test/c/prelude.sail (limited to 'test') 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 +$include + +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 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 + +val main : unit -> unit + +function main() = () -- cgit v1.2.3