summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorThomas Bauereiss2020-05-04 17:57:49 +0100
committerThomas Bauereiss2020-05-04 21:22:53 +0100
commitdc674a7320e4684e4dbe3ccf618c644bd83796ca (patch)
treed930b8c85c2be14ecfda1302ff25237e73e0796b /test
parent929469c81d863703aa5817bbbd92c697eca3af26 (diff)
Mono: Try to fix bug in inter-procedural analysis
The monomorphisation analysis decides whether to split function arguments in the callee or in callers. The code previously used a datastructure that can hold results of either the one case or the other, but there might be functions that are called in different contexts leading to different decisions. This patch changes the datastructure to support storing all instances of either case.
Diffstat (limited to 'test')
-rw-r--r--test/mono/itself_rewriting.sail9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/mono/itself_rewriting.sail b/test/mono/itself_rewriting.sail
index 4d67ee1a..4540f1a5 100644
--- a/test/mono/itself_rewriting.sail
+++ b/test/mono/itself_rewriting.sail
@@ -90,6 +90,13 @@ function transitive_itself(n) = {
()
}
+val transitive_split : bool -> unit
+
+function transitive_split(x) = {
+ let n = if x then 8 else 16;
+ transitive_itself(n);
+}
+
val run : unit -> unit effect {escape}
function run () = {
@@ -98,4 +105,6 @@ function run () = {
willsplit(true);
willsplit(false);
transitive_itself(16);
+ transitive_split(true);
+ transitive_split(false);
}