mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 10:19:19 +02:00
* ARM: New test to evaluate ADR encoding error
This commit is contained in:
parent
c4061e49e6
commit
6b569d0ada
34
tests/webtbs/tw40472.pp
Normal file
34
tests/webtbs/tw40472.pp
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{ %CPU=ARM }
|
||||||
|
program tw40472;
|
||||||
|
|
||||||
|
function AddrCheck(): LongInt; assembler; nostackframe;
|
||||||
|
asm
|
||||||
|
ADR R0, .L528Ahead
|
||||||
|
LDR R0, [R0]
|
||||||
|
BX LR
|
||||||
|
.LPadding:
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
|
.long 0, 0, 0
|
||||||
|
.L528Ahead:
|
||||||
|
.long 0x5555AAAA
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
Output: LongInt;
|
||||||
|
begin
|
||||||
|
Output := AddrCheck();
|
||||||
|
if Output <> $5555AAAA then
|
||||||
|
begin
|
||||||
|
WriteLn('ERROR: Expected $5555AAAA but got $', HexStr(Output, 8));
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
|
||||||
|
WriteLn('ok');
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user