mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 00:50:49 +02:00
+ test
git-svn-id: trunk@6203 -
This commit is contained in:
parent
d614eab0fb
commit
ca4412e09f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8006,6 +8006,7 @@ tests/webtbs/tw8156.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw8171.pp svneol=native#text/plain
|
tests/webtbs/tw8171.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8172.pp svneol=native#text/plain
|
tests/webtbs/tw8172.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8183.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/tw8222.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8222a.pp svneol=native#text/plain
|
tests/webtbs/tw8222a.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw8222b.pp svneol=native#text/plain
|
tests/webtbs/tw8222b.pp svneol=native#text/plain
|
||||||
|
56
tests/webtbs/tw8199.pp
Normal file
56
tests/webtbs/tw8199.pp
Normal file
@ -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.
|
Loading…
Reference in New Issue
Block a user