mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 05:00:07 +02:00
+ added testing for cdecl and array of const. (should not compile)
This commit is contained in:
parent
3d65591f76
commit
c3540440c3
26
tests/tbf/tb0139.pp
Normal file
26
tests/tbf/tb0139.pp
Normal 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
21
tests/tbf/tb0140.pp
Normal 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)
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user