diff options
| author | Kathy Gray | 2014-03-31 19:15:17 +0100 |
|---|---|---|
| committer | Kathy Gray | 2014-03-31 19:17:06 +0100 |
| commit | be24c3bebe32b41847338f2dc31c06b593ec1251 (patch) | |
| tree | 2c4912377f61a60f499f332bd530e5f397eccd10 /src/test | |
| parent | a4a5c1248c7a467ea9d1f8dfa77bc187803ae374 (diff) | |
Extend constraint checking, and add casts for base of a vector shifts (i.e. from 0 to 32 etc, doesn't change order yet.).
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/pattern.sail | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/pattern.sail b/src/test/pattern.sail index bc04590d..7bbfebf9 100644 --- a/src/test/pattern.sail +++ b/src/test/pattern.sail @@ -3,6 +3,9 @@ register nat n register nat x register nat y +typedef wordsize = forall Nat 'n, 'n IN {8,16,32}. [|'n|] +let forall Nat 'n. (wordsize<'n>) word = 8 + function nat main _ = { (* works - x and y are set to 42 *) @@ -14,7 +17,12 @@ function nat main _ = { case z -> { x := 99; x } }); - (* doesn't work - main returns 1 instead of 99 *) + switch word { + case 8 -> { x:= 32; } + case 16 -> { x:= 64; } + case 32 -> { x:= 128; } + }; + n := 3; switch n { case 0 -> { 21 } |
