mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 10:29:10 +02:00
changes to test if executable OK
This commit is contained in:
parent
4aba3f4ee5
commit
50eb9d04ad
@ -1,5 +1,10 @@
|
|||||||
|
{ this should be rejected because we only accept integer args }
|
||||||
|
|
||||||
program write_it;
|
program write_it;
|
||||||
var x:real;
|
var x,y:real;
|
||||||
begin
|
begin
|
||||||
write(x:5.2);
|
x:=5.6;
|
||||||
|
y:=45.789;
|
||||||
|
write(y:2:3,x:3:4);
|
||||||
|
{write(y:3.2,x:5.2);}
|
||||||
end.
|
end.
|
||||||
|
@ -6,6 +6,7 @@ var s: String;
|
|||||||
i: integer;
|
i: integer;
|
||||||
code: word;
|
code: word;
|
||||||
e: 0..10;
|
e: 0..10;
|
||||||
|
f : text;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
{$R-}
|
{$R-}
|
||||||
@ -13,18 +14,29 @@ Begin
|
|||||||
val(s, i, code); {no range check error may occur here}
|
val(s, i, code); {no range check error may occur here}
|
||||||
Writeln('Integer($fffff) = ',i);
|
Writeln('Integer($fffff) = ',i);
|
||||||
|
|
||||||
|
assign(f,'tbs0185.tmp');
|
||||||
|
rewrite(f);
|
||||||
|
Writeln(f,'20');
|
||||||
|
Writeln(f,'34');
|
||||||
|
close(f);
|
||||||
|
reset(f);
|
||||||
Write('Enter the value 20 (should not give a rangecheck error): ');
|
Write('Enter the value 20 (should not give a rangecheck error): ');
|
||||||
Readln(e);
|
Readln(f,e);
|
||||||
|
|
||||||
|
|
||||||
{$R+}
|
{$R+}
|
||||||
s := '$ffff';
|
s := '$ffff';
|
||||||
val(s, i, code); {no range check error may occur here}
|
val(s, i, code); {no range check error may occur here}
|
||||||
Writeln('integer($ffff) = ', i,'(should not give range check error)');
|
Writeln('integer($ffff) = ', i,'(should not give range check error)');
|
||||||
|
|
||||||
Writeln('Enter value from 0-10 to test Val rangecheck, another for subrange rangecheck: ');
|
Writeln('Enter value from 0-10 to test Val rangecheck, another for subrange rangecheck: ');
|
||||||
Readln(e);
|
Readln(f,e);
|
||||||
|
|
||||||
Writeln('If you entered a value different from 0-10, subrange range checks don''t work!');
|
Writeln('If you entered a value different from 0-10, subrange range checks don''t work!');
|
||||||
s := '65535';
|
s := '65535';
|
||||||
val(s, i, code); {must give a range check error}
|
val(s, i, code); {must give a range check error}
|
||||||
Writeln('Val range check failed!');
|
Writeln('Val range check failed!');
|
||||||
|
close(f);
|
||||||
|
erase(f);
|
||||||
|
Halt(1);
|
||||||
End.
|
End.
|
||||||
|
@ -19,8 +19,8 @@ asm
|
|||||||
addl rec.a(%ecx), %eax
|
addl rec.a(%ecx), %eax
|
||||||
movl %eax, rec.a(%edi)
|
movl %eax, rec.a(%edi)
|
||||||
|
|
||||||
movw rec.b(%ecx), %ax
|
movw rec.b(%ebx), %ax
|
||||||
addw rec.b(%edx), %ax
|
addw rec.b(%ecx), %ax
|
||||||
movw %ax, rec.b(%edi)
|
movw %ax, rec.b(%edi)
|
||||||
movw $1,%ax
|
movw $1,%ax
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user