summaryrefslogtreecommitdiff
path: root/test/c
diff options
context:
space:
mode:
authorAlasdair2020-08-10 20:09:39 +0100
committerAlasdair2020-08-10 20:24:21 +0100
commit2736af39811331502c7f5bc7e2bd8f590f1f9b2a (patch)
tree630fefdf372b1c946ab12eb6f8dd3ed69d48e74a /test/c
parent2fa4a0719eef21b90b6ae9bb4eafb5a779b55227 (diff)
Fix a C backend bug with letbindings in guards shadowing body definitions
Diffstat (limited to 'test/c')
-rw-r--r--test/c/match_bind.expect1
-rw-r--r--test/c/match_bind.sail11
2 files changed, 12 insertions, 0 deletions
diff --git a/test/c/match_bind.expect b/test/c/match_bind.expect
new file mode 100644
index 00000000..1754ece3
--- /dev/null
+++ b/test/c/match_bind.expect
@@ -0,0 +1 @@
+1. y = 3
diff --git a/test/c/match_bind.sail b/test/c/match_bind.sail
new file mode 100644
index 00000000..39738ac3
--- /dev/null
+++ b/test/c/match_bind.sail
@@ -0,0 +1,11 @@
+default Order dec
+
+$include <prelude.sail>
+
+function main() -> unit = {
+ let x: int = 3;
+ match x {
+ _ if let y = x in y == 3 => let y = x in print_int("1. y = ", y),
+ _ if let y = x in true => let y = x in print_int("2. y = ", y)
+ }
+} \ No newline at end of file