diff --git a/.gitattributes b/.gitattributes index e8c26b5946..ec09c59620 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13802,6 +13802,7 @@ tests/webtbs/tw25170.pp svneol=native#text/plain tests/webtbs/tw25198.pp svneol=native#text/plain tests/webtbs/tw25210.pp svneol=native#text/pascal tests/webtbs/tw2525.pp svneol=native#text/plain +tests/webtbs/tw25255.pp svneol=native#text/pascal tests/webtbs/tw25269.pp svneol=native#text/pascal tests/webtbs/tw25289.pp svneol=native#text/plain tests/webtbs/tw25296.pp svneol=native#text/plain diff --git a/compiler/nmat.pas b/compiler/nmat.pas index 3e54c52f62..e9a1d37855 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -1074,15 +1074,17 @@ implementation pasbool8, pasbool16, pasbool32, - pasbool64, + pasbool64: + v:=byte(not(boolean(int64(v)))); bool8bit, bool16bit, bool32bit, bool64bit: begin - v:=byte(not(boolean(int64(v)))); - if is_cbool(left.resultdef) then - v:=-v; + if v=0 then + v:=-1 + else + v:=0; end; uchar, uwidechar, diff --git a/tests/webtbs/tw25255.pp b/tests/webtbs/tw25255.pp new file mode 100644 index 0000000000..b6a00ec327 --- /dev/null +++ b/tests/webtbs/tw25255.pp @@ -0,0 +1,10 @@ +begin + if not(qwordbool($8000000000000000)) then + halt(1); + if not(longbool($80000000)) then + halt(1); + if not(wordbool($8000)) then + halt(1); + writeln('ok'); +end. +