mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-14 21:59:47 +02:00
* New test to detect SSE/AVX optimisation error
This commit is contained in:
parent
35e52b90f5
commit
1bcf4a5a8c
28
tests/webtbs/tw40401.pp
Normal file
28
tests/webtbs/tw40401.pp
Normal file
@ -0,0 +1,28 @@
|
||||
{ %OPT=-O3 }
|
||||
{$mode objfpc}
|
||||
program tw40401;
|
||||
|
||||
function OptPass1_V_MOVAP_Test: Single; noinline;
|
||||
var
|
||||
a, b, zero: single;
|
||||
begin
|
||||
repeat
|
||||
zero := 0 + random(0);
|
||||
a := 2 - zero;
|
||||
b := 5 - zero;
|
||||
Result := a * b; // must be 10
|
||||
until true;
|
||||
end;
|
||||
|
||||
var
|
||||
m: Single;
|
||||
begin
|
||||
m := OptPass1_V_MOVAP_Test();
|
||||
if m <> 10 then
|
||||
begin
|
||||
WriteLn('FAIL - returned' , m);
|
||||
Halt(1);
|
||||
end;
|
||||
|
||||
WriteLn('ok');
|
||||
end.
|
Loading…
Reference in New Issue
Block a user