From ca4412e09f69381d731e19e0afc73c6d81cc27bf Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 26 Jan 2007 17:40:30 +0000 Subject: [PATCH] + test git-svn-id: trunk@6203 - --- .gitattributes | 1 + tests/webtbs/tw8199.pp | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/webtbs/tw8199.pp diff --git a/.gitattributes b/.gitattributes index 1465c4de6d..ef086d6df1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8006,6 +8006,7 @@ tests/webtbs/tw8156.pp svneol=native#text/plain tests/webtbs/tw8171.pp svneol=native#text/plain tests/webtbs/tw8172.pp svneol=native#text/plain tests/webtbs/tw8183.pp svneol=native#text/plain +tests/webtbs/tw8199.pp svneol=native#text/plain tests/webtbs/tw8222.pp svneol=native#text/plain tests/webtbs/tw8222a.pp svneol=native#text/plain tests/webtbs/tw8222b.pp svneol=native#text/plain diff --git a/tests/webtbs/tw8199.pp b/tests/webtbs/tw8199.pp new file mode 100644 index 0000000000..ebcd6f98bb --- /dev/null +++ b/tests/webtbs/tw8199.pp @@ -0,0 +1,56 @@ +{ %cpu=i386 } +{$APPTYPE CONSOLE} + +{$ifdef fpc} + {$mode delphi} +{$endif} + +program AsmDifference; + +type + TnxInt64 = Int64; {64-bit signed Integer} + TnxValueRelationship = -1..1; + +const + nxSmallerThan = Low(TnxValueRelationship); + nxEqual = 0; + nxGreaterThan = High(TnxValueRelationship); + +function nxCmpI64(const a, b : TnxInt64) : TnxValueRelationship; +//begin +// if a = b then +// Result := nxEqual +// else if a < b then +// Result := nxSmallerThan +// else +// Result := nxGreaterThan; +//end; +asm + xor eax, eax + mov edx, [ebp+20] + cmp edx, [ebp+12] + jg @@GT + jl @@LT + mov edx, [ebp+16] + cmp edx, [ebp+8] + ja @@GT + je @@EQ +@@LT: + dec eax + dec eax +@@GT: + inc eax +@@EQ: +end; + +var + a, b: TnxInt64; + +begin + a := 12884901889; + b := 12884901890; + + if nxCmpI64(a, b)<>-1 then + halt(1); + writeln('ok'); +end.