summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-08-21 19:12:38 +0100
committerAlasdair Armstrong2018-08-21 19:12:38 +0100
commit581b72df349055c6bfdfb906b070984043e45840 (patch)
treef0c8696da4d16c0b1236fe5c36af7990f59a1b37 /test
parent7542e0d88b914fd949ad023284db773e61ce6b5a (diff)
C: Correctly handle the kinds of patterns generated by mappings
This change allows the RISC-V spec to compile to C, but more testing is needed to ensure it works correctly.
Diffstat (limited to 'test')
-rw-r--r--test/c/single_arg.expect1
-rw-r--r--test/c/single_arg.sail15
2 files changed, 16 insertions, 0 deletions
diff --git a/test/c/single_arg.expect b/test/c/single_arg.expect
new file mode 100644
index 00000000..7ed6ff82
--- /dev/null
+++ b/test/c/single_arg.expect
@@ -0,0 +1 @@
+5
diff --git a/test/c/single_arg.sail b/test/c/single_arg.sail
new file mode 100644
index 00000000..6b746d11
--- /dev/null
+++ b/test/c/single_arg.sail
@@ -0,0 +1,15 @@
+default Order dec
+
+$include <prelude.sail>
+
+val f : (int, int) -> int
+
+function f(x) = {
+ match x {
+ (y, z) => y + z
+ }
+}
+
+function main() : unit -> unit = {
+ print_int("", f(2, 3));
+} \ No newline at end of file