Browse Source

+ test for mantis #36381 (seems already fixed)

git-svn-id: trunk@47337 -
Jonas Maebe 4 years ago
parent
commit
49fbe53cf3
2 changed files with 33 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 32 0
      tests/webtbs/tw36381.pp

+ 1 - 0
.gitattributes

@@ -18416,6 +18416,7 @@ tests/webtbs/tw36212.pp svneol=native#text/pascal
 tests/webtbs/tw36215.pp svneol=native#text/pascal
 tests/webtbs/tw3628.pp svneol=native#text/plain
 tests/webtbs/tw3634.pp svneol=native#text/plain
+tests/webtbs/tw36381.pp svneol=native#text/plain
 tests/webtbs/tw36388.pp svneol=native#text/pascal
 tests/webtbs/tw36389.pp svneol=native#text/pascal
 tests/webtbs/tw36496a.pp svneol=native#text/pascal

+ 32 - 0
tests/webtbs/tw36381.pp

@@ -0,0 +1,32 @@
+{$mode objfpc}
+
+program test;
+
+type
+  TVec2 = record
+    x, y: single;
+  end;
+
+function ViewToWorld (x, y: single): TVec2; overload;
+begin
+  result.x := x;
+  result.y := y;
+end;
+
+function ViewToWorld (pt: TVec2): TVec2; overload; inline;
+begin
+  result := ViewToWorld(pt.x, pt.y);
+end;
+
+var
+  pt: TVec2;
+begin
+  pt.x:=1.0;
+  pt.y:=2.0;
+  // ERROR: Internal error 2009112601
+  pt := ViewToWorld(pt);
+  if pt.x<>1.0 then
+    halt(1);
+  if pt.y<>2.0 then
+    halt(2);
+end.