summaryrefslogtreecommitdiff
path: root/tests/tbs
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-12-27 13:18:47 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-12-27 13:18:47 +0000
commitba840dc3f6f8a43d05ba6c20962811ce1ac5cea9 (patch)
treec08b71239b6af2eb57bea1d72f30390099308cca /tests/tbs
parent5b0c6f315ceb68a2d49c545516e9d806a9875e19 (diff)
downloadfpc-ba840dc3f6f8a43d05ba6c20962811ce1ac5cea9.tar.gz
* generate more efficient code for trunc(currency), trunc(comp), and
round(comp) on platforms where currency and comp are handled using the FPU o also fixes trunc(comp) and trunc(currency) compilation for x86 on LLVM with -Oofastmath * add missing removal of excess fpu precision typecasts for trunc/round git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@47854 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'tests/tbs')
-rw-r--r--tests/tbs/tb0683.pp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/tbs/tb0683.pp b/tests/tbs/tb0683.pp
new file mode 100644
index 0000000000..3f10d042a6
--- /dev/null
+++ b/tests/tbs/tb0683.pp
@@ -0,0 +1,22 @@
+{$ifndef SKIP_CURRENCY_TEST}
+var
+ c: currency;
+ co: comp;
+ i: int64;
+begin
+ c:=10.25;
+ co:=12;
+ i:=trunc(c);
+ if i<>10 then
+ halt(1);
+ i:=trunc(co);
+ if i<>12 then
+ halt(2);
+ i:=round(co);
+ if i<>12 then
+ halt(3);
+end.
+{$else}
+begin
+end.
+{$endif}