mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-19 17:22:33 +02:00

tests o currently not yet integrated in the makefile system, use testall.sh/ testall.bat to run the tests git-svn-id: branches/jvmbackend@18777 -
41 lines
565 B
ObjectPascal
41 lines
565 B
ObjectPascal
program tconst;
|
|
|
|
{$mode delphi}
|
|
|
|
uses
|
|
jdk15;
|
|
|
|
type
|
|
tc = class
|
|
const x: longint = 5;
|
|
end;
|
|
|
|
ttypedconstrec = record
|
|
l: longint;
|
|
end;
|
|
|
|
procedure test; overload;
|
|
const
|
|
l: longint = 1;
|
|
r: ttypedconstrec = (l: 5);
|
|
begin
|
|
if r.l<>5 then
|
|
raise jlexception.create('test1 r.l');
|
|
if l<>1 then
|
|
raise jlexception.create('test1 l');
|
|
end;
|
|
|
|
procedure test(x: byte); overload;
|
|
const
|
|
{ check that it gets a different mangled name }
|
|
l: longint = 4;
|
|
begin
|
|
if l<>4 then
|
|
raise jlexception.create('test1 l');
|
|
end;
|
|
|
|
begin
|
|
test;
|
|
test(3);
|
|
end.
|