From 407084d0a3a5bf527430e338bd085062dc78f8ae Mon Sep 17 00:00:00 2001 From: Kathy Gray Date: Tue, 15 Apr 2014 11:39:34 +0100 Subject: 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 _ --- src/test/pattern.sail | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/test') 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 } -- cgit v1.2.3