summaryrefslogtreecommitdiff
path: root/float_test10.bpl
diff options
context:
space:
mode:
authorGravatar Checkmate50 <dgeisler50@gmail.com>2016-01-04 19:26:36 -0800
committerGravatar Checkmate50 <dgeisler50@gmail.com>2016-01-04 19:26:36 -0800
commit6fad4313b1a4e7f8e6cfcd12b92126a3d9ad58d0 (patch)
tree7404eda3568a7f271ea2827f8e1603c139c5b452 /float_test10.bpl
parenta1c9e11736bda4bf8ea4bf431523b9b975b01670 (diff)
Added several test cases and some basic documentation for fp usage
Diffstat (limited to 'float_test10.bpl')
-rw-r--r--float_test10.bpl21
1 files changed, 18 insertions, 3 deletions
diff --git a/float_test10.bpl b/float_test10.bpl
index 7423a3a0..566f7a56 100644
--- a/float_test10.bpl
+++ b/float_test10.bpl
@@ -1,5 +1,20 @@
- procedure F() returns () {
+//Translation from loop.c
+//Should return an error? (The real case does as well...)
+
+procedure main() returns () {
var x : float;
- x := fp (0.5 23 8);
- assert x == fp (0 -1);
+ var y : float;
+ var z : float;
+
+ x := fp(1);
+ y := fp(10000000);
+ z := fp(42);
+
+ while (x < y) {
+ x := x + fp(1);
+ y := y - fp(1);
+ z := z + fp(1);
+ }
+
+ assert(z >= fp(0) && z <= fp(10000000));
} \ No newline at end of file