diff options
| author | Brian Campbell | 2018-07-24 17:38:18 +0100 |
|---|---|---|
| committer | Brian Campbell | 2018-07-24 17:38:18 +0100 |
| commit | 8b1bbeed703da7ba78dfe2728c99b0ec9088cf47 (patch) | |
| tree | 835f9ae7fcd17b440d9a7b674ae58ee32bae0d30 /test | |
| parent | 8114501b7b956ee4a98fa8599c7efee62fc19206 (diff) | |
Move monomorphisation after mapping rewrites
Fixes monomorphisation on files using mappings.
Also extended constant propagation to handle pattern matches on
bitvector expressions (because an earlier rewrite replaces the literals).
Also moved L_undef rewriting because monomorphisation can handle them
but not the replacement functions.
Diffstat (limited to 'test')
| -rw-r--r-- | test/mono/mapping.sail | 16 | ||||
| -rw-r--r-- | test/mono/pass/mapping | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/test/mono/mapping.sail b/test/mono/mapping.sail new file mode 100644 index 00000000..ecc06b0b --- /dev/null +++ b/test/mono/mapping.sail @@ -0,0 +1,16 @@ +$include <flow.sail> + +/* Trivial example with mapping that doesn't really need monomorphised */ + +enum foo = {A,B} + +mapping map_foo : foo <-> bool = { + A <-> true, + B <-> false +} + +val run : unit -> unit effect {escape} + +function run() = { + assert(map_foo(A)) +}
\ No newline at end of file diff --git a/test/mono/pass/mapping b/test/mono/pass/mapping new file mode 100644 index 00000000..3a95be81 --- /dev/null +++ b/test/mono/pass/mapping @@ -0,0 +1 @@ +mapping.sail -auto_mono
\ No newline at end of file |
