fpc/tests/test/jvm/tconst.pp
Jonas Maebe 740e7ca6b5 + a bunch of jvm-specific tests: partly new, partly derived from existing
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 -
2011-08-20 08:35:11 +00:00

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.