fpc/tests/webtbs/tw23436.pp
Jonas Maebe 29095e9dd3 * fixed if-simplication for C-style booleans by considering all values
different from 0 to be "true", instead of only 1 (patch by Jeppe Johansen,
    mantis #23436)

git-svn-id: trunk@23117 -
2012-12-06 15:18:58 +00:00

45 lines
778 B
ObjectPascal

program testcase;
{$APPTYPE CONSOLE}
{$mode objfpc}
begin
if ByteBool(true) then
writeln('ByteBool(true) ok')
else
halt(1);
if not ByteBool(false) then
writeln('ByteBool(not false) ok')
else
halt(2);
if WordBool(true) then
writeln('WordBool(true) ok')
else
halt(3);
if not WordBool(false) then
writeln('WordBool(not false) ok')
else
halt(4);
if LongBool(true) then
writeln('LongBool(true) ok')
else
halt(5);
if not LongBool(false) then
writeln('LongBool(not false) ok')
else
halt(6);
{$ifdef FPC}
if QWordBool(true) then
writeln('QWordBool(true) ok')
else
halt(7);
if not QWordBool(false) then
writeln('QWordBool(not false) ok')
else
halt(8);
{$endif FPC}
Writeln('ok');
end.