summaryrefslogtreecommitdiff
path: root/Test/floats/float9.bpl
blob: cb4f3afd55a6d982ec8e667113c34a6f12ae2c85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %boogie -proverWarnings:1 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_INT(int) returns (float32);
function {:builtin "(_ to_fp 8 24) RNE"} TO_FLOAT32_REAL(real) returns (float32);

procedure main() returns () {
	var x : float32;
	var y : float32;
	var z : float32;
	var r : float32;
	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);
}