mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 20:09:23 +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;
|
||||
var x:real;
|
||||
var x,y:real;
|
||||
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.
|
||||
|
@ -6,6 +6,7 @@ var s: String;
|
||||
i: integer;
|
||||
code: word;
|
||||
e: 0..10;
|
||||
f : text;
|
||||
|
||||
Begin
|
||||
{$R-}
|
||||
@ -13,18 +14,29 @@ Begin
|
||||
val(s, i, code); {no range check error may occur here}
|
||||
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): ');
|
||||
Readln(e);
|
||||
Readln(f,e);
|
||||
|
||||
|
||||
{$R+}
|
||||
s := '$ffff';
|
||||
val(s, i, code); {no range check error may occur here}
|
||||
Writeln('integer($ffff) = ', i,'(should not give range check error)');
|
||||
|
||||
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!');
|
||||
s := '65535';
|
||||
val(s, i, code); {must give a range check error}
|
||||
Writeln('Val range check failed!');
|
||||
close(f);
|
||||
erase(f);
|
||||
Halt(1);
|
||||
End.
|
||||
|
@ -19,8 +19,8 @@ asm
|
||||
addl rec.a(%ecx), %eax
|
||||
movl %eax, rec.a(%edi)
|
||||
|
||||
movw rec.b(%ecx), %ax
|
||||
addw rec.b(%edx), %ax
|
||||
movw rec.b(%ebx), %ax
|
||||
addw rec.b(%ecx), %ax
|
||||
movw %ax, rec.b(%edi)
|
||||
movw $1,%ax
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user