fpc/tests/test/jvm/tconst.pp
Jonas Maebe 71068ae7eb * made the tests Android-compatible (use the androidr14 unit instead
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 -
2011-12-12 20:34:02 +00:00

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.