From 13ad54f450a11a9c4eecdd782036e50ea2a41cd8 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 21 Mar 2019 18:54:16 +0000 Subject: Jib: Add types to Phi functions Add a test case to ensure variable types in l-expressions remain the same with flow-sensitive constraints. --- test/c/flow_restrict.expect | 1 + test/c/flow_restrict.sail | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/c/flow_restrict.expect create mode 100644 test/c/flow_restrict.sail (limited to 'test') diff --git a/test/c/flow_restrict.expect b/test/c/flow_restrict.expect new file mode 100644 index 00000000..9766475a --- /dev/null +++ b/test/c/flow_restrict.expect @@ -0,0 +1 @@ +ok diff --git a/test/c/flow_restrict.sail b/test/c/flow_restrict.sail new file mode 100644 index 00000000..ef2ec412 --- /dev/null +++ b/test/c/flow_restrict.sail @@ -0,0 +1,23 @@ +default Order dec + +$include +$include + +val "print_endline" : string -> unit + +register R : bool + +function main((): unit) -> unit = { + R = false; + let 'x = 3180327502475943573495720457203572045720485720458724; + y : range(0, 'x) = 1; + if R then { + assert(constraint('x <= 2)); + y = 2; + let z = y; + let x = 2; + () + } else { + print_endline("ok") + } +} -- cgit v1.2.3