Browse Source

* New test for management operators to detect regressions like regression fixed in r35461 (many times initialized global variables)

git-svn-id: trunk@35463 -
maciej-izak 8 năm trước cách đây
mục cha
commit
533c89e128
2 tập tin đã thay đổi với 30 bổ sung0 xóa
  1. 1 0
      .gitattributes
  2. 29 0
      tests/test/tmoperator11.pp

+ 1 - 0
.gitattributes

@@ -12709,6 +12709,7 @@ tests/test/tmcbool2.pp svneol=native#text/plain
 tests/test/tmmx1.pp svneol=native#text/plain
 tests/test/tmoperator1.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/tmoperator3.pp svneol=native#text/pascal
 tests/test/tmoperator4.pp svneol=native#text/pascal

+ 29 - 0
tests/test/tmoperator11.pp

@@ -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.