mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 21:43:30 +02:00
* New test to catch issue identified in #40003
This commit is contained in:
parent
cc27576339
commit
5704626762
20
tests/webtbs/tw40003.pp
Normal file
20
tests/webtbs/tw40003.pp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ %OPT=-O2 }
|
||||||
|
|
||||||
|
program tw40003;
|
||||||
|
|
||||||
|
{ Code triggers faulty optimisation in OptPass2Movx }
|
||||||
|
|
||||||
|
{$mode objfpc} {$typedaddress on}
|
||||||
|
var
|
||||||
|
value, thirdByte: uint32;
|
||||||
|
begin
|
||||||
|
(@value)^ := $11223344 + random(0);
|
||||||
|
thirdByte := byte(value shr 16);
|
||||||
|
writeln('byte($11223344 shr 16) = $', HexStr(thirdByte, 1 + BsrDWord(thirdByte) div 4), ' (must be $22)');
|
||||||
|
if thirdbyte <> 34 then
|
||||||
|
begin
|
||||||
|
WriteLn('FAIL');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
WriteLn('ok');
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user