mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* New test for i40647
This commit is contained in:
parent
1e0f6f9f64
commit
068b8f9e9d
17
tests/webtbs/tw40647.pp
Normal file
17
tests/webtbs/tw40647.pp
Normal file
@ -0,0 +1,17 @@
|
||||
{ %OPT=-O1 }
|
||||
program tw40647;
|
||||
var
|
||||
k: longint = 2;
|
||||
x: longint;
|
||||
begin
|
||||
{ Tests faulty LEA optimisations that manifest under -O1 since the node
|
||||
tree doesn't simplify k + k in this instance }
|
||||
x := k + k + 1;
|
||||
if x <> 5 then
|
||||
begin
|
||||
WriteLn('FAIL: Expected 5 but got ', x);
|
||||
Halt(1);
|
||||
end;
|
||||
|
||||
WriteLn('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user