summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-08-20 15:30:29 +0100
committerAlasdair Armstrong2018-08-20 15:30:29 +0100
commit1d7b5f0ddaa6b80babc34180fee5fb4f191283e4 (patch)
tree87bfeb74d91651591d36dd81efbe44dce6cb87b7 /test
parent3414ffbc4d62f5cb019def6a6e9931319ac1ffa7 (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.expect1
-rw-r--r--test/c/mapping.sail17
-rw-r--r--test/c/prelude.expect0
-rw-r--r--test/c/prelude.sail7
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() = ()