summaryrefslogtreecommitdiff
path: root/Test/floats/float11.bpl
diff options
context:
space:
mode:
authorGravatar RustanLeino <leino@microsoft.com>2016-08-17 13:40:57 -0700
committerGravatar GitHub <noreply@github.com>2016-08-17 13:40:57 -0700
commit12d1543333babd202d76e259418dd03c0c7c56c3 (patch)
tree69bd181ccb97621378ab630a1357bd5583cc96a8 /Test/floats/float11.bpl
parent529b1bc37b6da3f40dc85aef4cf252e9c98dd566 (diff)
parent2b64144fb02b68d00188ee81c27afa5fbc026b5b (diff)
Merge pull request #35 from Checkmate50/master
Floating Point Support
Diffstat (limited to 'Test/floats/float11.bpl')
-rw-r--r--Test/floats/float11.bpl22
1 files changed, 22 insertions, 0 deletions
diff --git a/Test/floats/float11.bpl b/Test/floats/float11.bpl
new file mode 100644
index 00000000..de148424
--- /dev/null
+++ b/Test/floats/float11.bpl
@@ -0,0 +1,22 @@
+// RUN: %boogie -proverWarnings:1 "%s" > "%t"
+// RUN: %diff "%s.expect" "%t"
+
+function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_INT(int) returns (float24e8);
+function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_REAL(real) returns (float24e8);
+
+procedure main() returns () {
+ var tick : float24e8;
+ var time : float24e8;
+ var i: int;
+
+ tick := TO_FLOAT32_INT(1)/TO_FLOAT32_INT(10);
+ time := TO_FLOAT32_INT(0);
+
+ i := 0;
+ while (i < 10)
+ {
+ time := time + tick;
+ i := i + 1;
+ }
+ assert time == TO_FLOAT32_INT(1);
+} \ No newline at end of file