summaryrefslogtreecommitdiff
path: root/Test/floats/float9.bpl
diff options
context:
space:
mode:
Diffstat (limited to 'Test/floats/float9.bpl')
-rw-r--r--Test/floats/float9.bpl17
1 files changed, 17 insertions, 0 deletions
diff --git a/Test/floats/float9.bpl b/Test/floats/float9.bpl
new file mode 100644
index 00000000..b1e46ae4
--- /dev/null
+++ b/Test/floats/float9.bpl
@@ -0,0 +1,17 @@
+// 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 x : float24e8;
+ var y : float24e8;
+ var z : float24e8;
+ var r : float24e8;
+ x := TO_FLOAT32_REAL(1e7);
+ y := x + TO_FLOAT32_INT(1);
+ z := x - TO_FLOAT32_INT(1);
+ r := y - z;
+ assert r == TO_FLOAT32_INT(2);
+} \ No newline at end of file