mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 23:19:26 +02:00

of the jdk15 unit in that case) * adjusted testall.sh script so it can also be used to test class files compiled for Android (still with the JVM though) git-svn-id: branches/jvmbackend@19835 -
41 lines
603 B
ObjectPascal
41 lines
603 B
ObjectPascal
program tconst;
|
|
|
|
{$mode delphi}
|
|
|
|
uses
|
|
{$ifdef java}jdk15{$else}androidr14{$endif};
|
|
|
|
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.
|