+ added testing for cdecl and array of const. (should not compile)

This commit is contained in:
carl 2002-11-09 21:57:57 +00:00
parent 3d65591f76
commit c3540440c3
2 changed files with 47 additions and 0 deletions

26
tests/tbf/tb0139.pp Normal file
View File

@ -0,0 +1,26 @@
{%fail}
{
This program should fail compilation since the high()
parameter cannot be used in a cdecl'ed function using
array of const, it uses the exact calling conventions
as a C compiler, and the length is not passed!
}
procedure proc_const_smallarray_const_2(const arr : array of const);cdecl;
var
i: integer;
begin
if high(arr)<0 then
WriteLn('hello world!');
end;
Begin
end.
{
$Log$
Revision 1.1 2002-11-09 21:57:57 carl
+ added testing for cdecl and array of const. (should not compile)
}

21
tests/tbf/tb0140.pp Normal file
View File

@ -0,0 +1,21 @@
{%fail}
{
This program should fail compilation since array of const
with cdecl modifier can only be used on last parameter of
routine
}
procedure proc_const_smallarray_const_2(const arr : array of const; b: byte);cdecl;
begin
end;
Begin
end.
{
$Log$
Revision 1.1 2002-11-09 21:57:57 carl
+ added testing for cdecl and array of const. (should not compile)
}