summaryrefslogtreecommitdiff
path: root/src/test/vectors.sail
diff options
context:
space:
mode:
authorGabriel Kerneis2014-01-14 18:17:18 +0100
committerGabriel Kerneis2014-01-14 18:57:47 +0100
commit048256944331ed646225e856fca56728a074f3a6 (patch)
treeb04a297de796a1a19061cf4ec213e43cac199856 /src/test/vectors.sail
parent3a2d580deda67a57c3bf29f5fbd350e366c8562b (diff)
Fix vector concat pattern matching
The concatenation list was reversed.
Diffstat (limited to 'src/test/vectors.sail')
-rw-r--r--src/test/vectors.sail12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/vectors.sail b/src/test/vectors.sail
index f51b5d93..f6e0c532 100644
--- a/src/test/vectors.sail
+++ b/src/test/vectors.sail
@@ -21,17 +21,17 @@ function unit main _ = {
case _ -> match_success := i
};
- (* XXX function clause match fail *)
- (* parameter is wrapped in a 1-tuple upon call, but probably not
- unwrapped for the pattern-matching *)
decode(i);
(* concatenation *)
switch i {
- (* XXX match fails *)
case ([bitzero] : [bitzero, bitone] : [bitzero]) -> match_success := 1
- (* but this works *)
- case ([bitzero] : [bitzero] : [bitone] : [bitzero]) -> match_success := 2
+ case _ -> match_success := i
+ };
+ switch i {
+ (* check order of concatenation *)
+ case ([bitzero] : [bitone] : [bitzero] : [bitzero]) -> match_success := 99
+ case ([bitzero] : [bitzero] : [bitone] : [bitzero]) -> match_success := 1
case _ -> match_success := i
};