diff --git a/tests/test/testintl.pp b/tests/test/testintl.pp index 8409796c54..a82768214e 100644 --- a/tests/test/testintl.pp +++ b/tests/test/testintl.pp @@ -16,6 +16,30 @@ asm end; +function get_local_value : longint; +var + x : longint; +begin + x:=66; + asm + mov eax,dword ptr [x] + mov @result,eax + end; +end; + +function get_local_addr : pointer; +var + x : longint; +begin + x:=66; + asm + mov eax,x + mov @result,eax + end; +end; + +const + program_has_error : boolean = false; {$endif CPU86} begin @@ -23,13 +47,25 @@ begin sti:=56; if get_sti_value<>sti then begin - Writeln(' "mov eax,sti" does not get the address of sti var'); - Halt(1); + Writeln(' "mov eax,dword ptr [sti]" does not get the value of static sti var'); + program_has_error:=true; end; if get_sti_addr<>@sti then begin Writeln(' "mov eax,sti" does not get the address of sti var'); - Halt(1); + program_has_error:=true; end; + if get_local_value<>66 then + begin + Writeln(' "mov eax,dword ptr [x]" does not get the value of local x var'); + program_has_error:=true; + end; + if longint(get_local_addr)=66 then + begin + Writeln(' "mov eax,x" gets the value of local x var'); + program_has_error:=true; + end; + if program_has_error then + Halt(1); {$endif CPU86} -end. +end. \ No newline at end of file