diff options
Diffstat (limited to 'test/mono/nonlinearpat.sail')
| -rw-r--r-- | test/mono/nonlinearpat.sail | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/mono/nonlinearpat.sail b/test/mono/nonlinearpat.sail new file mode 100644 index 00000000..e0aaeff3 --- /dev/null +++ b/test/mono/nonlinearpat.sail @@ -0,0 +1,17 @@ +default Order dec +$include <prelude.sail> + +val test : forall 'n, 'n in {8,16}. (int('n),int('n),bits(1)) -> bits(64) effect pure + +function test(x,y,b) = { + let 'z = x + y in + let v : bits('z) = sail_zero_extend(b,z) in + sail_zero_extend(v,64) +} + +val run : unit -> unit effect {escape} + +function run () = { + assert(test(8,8,0b0) == 0x0000000000000000); + assert(test(16,16,0b1) == 0x0000000000000001); +} |
