mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 12:09:06 +02:00
* New test for management operators to detect regressions like regression fixed in r35461 (many times initialized global variables)
git-svn-id: trunk@35463 -
This commit is contained in:
parent
b86f2d7e3c
commit
533c89e128
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12709,6 +12709,7 @@ tests/test/tmcbool2.pp svneol=native#text/plain
|
|||||||
tests/test/tmmx1.pp svneol=native#text/plain
|
tests/test/tmmx1.pp svneol=native#text/plain
|
||||||
tests/test/tmoperator1.pp svneol=native#text/pascal
|
tests/test/tmoperator1.pp svneol=native#text/pascal
|
||||||
tests/test/tmoperator10.pp svneol=native#text/pascal
|
tests/test/tmoperator10.pp svneol=native#text/pascal
|
||||||
|
tests/test/tmoperator11.pp svneol=native#text/pascal
|
||||||
tests/test/tmoperator2.pp svneol=native#text/pascal
|
tests/test/tmoperator2.pp svneol=native#text/pascal
|
||||||
tests/test/tmoperator3.pp svneol=native#text/pascal
|
tests/test/tmoperator3.pp svneol=native#text/pascal
|
||||||
tests/test/tmoperator4.pp svneol=native#text/pascal
|
tests/test/tmoperator4.pp svneol=native#text/pascal
|
||||||
|
29
tests/test/tmoperator11.pp
Normal file
29
tests/test/tmoperator11.pp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
program tmoperator11;
|
||||||
|
|
||||||
|
{$MODE DELPHI}
|
||||||
|
|
||||||
|
var
|
||||||
|
i: Integer = 0;
|
||||||
|
|
||||||
|
type
|
||||||
|
TFoo = record
|
||||||
|
class operator Initialize(var aFoo: TFoo);
|
||||||
|
procedure Foo;
|
||||||
|
end;
|
||||||
|
|
||||||
|
class operator TFoo.Initialize(var aFoo: TFoo);
|
||||||
|
begin
|
||||||
|
Inc(i);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFoo.Foo;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
f: TFoo;
|
||||||
|
begin
|
||||||
|
if i <> 1 then
|
||||||
|
Halt(1);
|
||||||
|
f.Foo;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user