summaryrefslogtreecommitdiff
path: root/test/mono/castreq.sail
diff options
context:
space:
mode:
authorBrian Campbell2018-04-03 14:01:12 +0100
committerBrian Campbell2018-04-04 14:45:00 +0100
commitd21f59085e7f531c15c5c58dfb691f418314c929 (patch)
tree6a83359178f6f66b871a137454e08154a7396dc5 /test/mono/castreq.sail
parent9af69d070ba3b89e9f0c510f357e3fd0f99239b9 (diff)
Instantiate type properly when introducing mono casts
(also reorder the phases a little)
Diffstat (limited to 'test/mono/castreq.sail')
-rw-r--r--test/mono/castreq.sail11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/mono/castreq.sail b/test/mono/castreq.sail
index 553cf2b4..67a7fc8e 100644
--- a/test/mono/castreq.sail
+++ b/test/mono/castreq.sail
@@ -74,6 +74,15 @@ and foo2(64,x) =
let y : bits(16) = extzv(x) in
let z = y@y@y@y in let dfsf = 4 in z
+val foo3 : forall 'm 'n, 'n in {4,8}. (atom('n), bits('m)) -> bits(8 * 'n) effect pure
+
+function foo3(4,x) =
+ let y : bits(16) = extzv(x) in
+ y@y
+and foo3(8,x) =
+ let y : bits(16) = extzv(x) in
+ let z = y@y@y@y in let dfsf = 4 in z
+
/* Casting an argument isn't supported yet
val bar2 : forall 'n, 'n in {8,16}. (atom('n),bits('n)) -> unit effect pure
@@ -99,4 +108,6 @@ function run () = {
assert((assign(0x1234) : bits(64)) == 0x1234123412341234);
assert(foo2(32,0x12) == 0x00120012);
assert(foo2(64,0x12) == 0x0012001200120012);
+ assert(foo3(4,0x12) == 0x00120012);
+ assert(foo3(8,0x12) == 0x0012001200120012);
} \ No newline at end of file