From 4726bde00248f02203cdb9e642a619f3fdcdce0d Mon Sep 17 00:00:00 2001 From: pierre Date: Tue, 29 Oct 2002 17:04:34 +0000 Subject: [PATCH] test for bug #1720 --- tests/webtbs/tw1720.pp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/webtbs/tw1720.pp diff --git a/tests/webtbs/tw1720.pp b/tests/webtbs/tw1720.pp new file mode 100644 index 0000000000..c542f6c344 --- /dev/null +++ b/tests/webtbs/tw1720.pp @@ -0,0 +1,27 @@ +{ Source provided for Free Pascal Bug Report 1720 } +{ Submitted by "Jesse Towner" on 2001-12-09 } +{ e-mail: jesse@gdnmail.net } +var a, b, c : single; +begin + (* ... other floating point code goes here *) + + a := 5.6; + b := 3.4; + b:= b + sqrt(b)- ln(a); + + c := a - (b-(b-1)); + + if abs(c-(a-1))>0.01 then + begin + Writeln('Error in floating point code'); + halt(1); + end; + (* sometimes, depending on the previous code, + the code generator will chose to swap the + operands. however, it just calls the + reverse version of the instruction without + swapping the operands. this results in + giving a value of (b-a) or -2.2 for c. the + same goes for floating point division. *) +end. +