summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorKathy Gray2014-04-15 11:39:34 +0100
committerKathy Gray2014-04-15 11:39:34 +0100
commit407084d0a3a5bf527430e338bd085062dc78f8ae (patch)
tree96b5f2f161140a0e192ac874d71f9f1257d81d3f /src/test
parentb6c01ea4e538cdd3d92f6ca2543e8ea95d542344 (diff)
Use type information in vector concatenation pattern matching in interpreter.
Does not properly bind variables (i.e. in the pattern 0b01:(bit[3]) a: 0b0001 subsequent uses of a will not be bound in the interpreter, though they are in the type checker), so until bug is fixed, treat all such identifiers as _
Diffstat (limited to 'src/test')
-rw-r--r--src/test/pattern.sail5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/pattern.sail b/src/test/pattern.sail
index 7bbfebf9..cabe7dad 100644
--- a/src/test/pattern.sail
+++ b/src/test/pattern.sail
@@ -23,6 +23,11 @@ function nat main _ = {
case 32 -> { x:= 128; }
};
+ switch 0b010101 {
+ case (0b01:(bit[1]) _:0b101) -> n:= 42
+ case _ -> n:=0
+ };
+
n := 3;
switch n {
case 0 -> { 21 }