Browse Source

* check zero-extending of parameters < sizeof(aint)

git-svn-id: trunk@3656 -
Jonas Maebe 19 years ago
parent
commit
ea86114f96
2 changed files with 46 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 45 0
      tests/test/cg/tcalval10.pp

+ 1 - 0
.gitattributes

@@ -5539,6 +5539,7 @@ tests/test/cg/tcalpvr6.pp svneol=native#text/plain
 tests/test/cg/tcalpvr7.pp svneol=native#text/plain
 tests/test/cg/tcalpvr8.pp svneol=native#text/plain
 tests/test/cg/tcalval1.pp svneol=native#text/plain
+tests/test/cg/tcalval10.pp -text
 tests/test/cg/tcalval2.pp svneol=native#text/plain
 tests/test/cg/tcalval3.pp svneol=native#text/plain
 tests/test/cg/tcalval4.pp svneol=native#text/plain

+ 45 - 0
tests/test/cg/tcalval10.pp

@@ -0,0 +1,45 @@
+{ %target=darwin }
+
+type
+  tr= packed  record
+    b1, b2: byte;
+  end;
+
+procedure test(b: tr);mwpascal;
+begin
+  if b.b2 <> 5 then
+    halt(1);
+end;
+
+procedure t;
+var
+  r: tr;
+begin
+  r.b2 := 5;
+  test(r);
+end;
+
+procedure t2(b: byte); mwpascal;
+var
+  p: plongint;
+begin
+  p := plongint(@b);
+  if p^ <> 1 then
+    halt(2);
+end;
+
+procedure t3;
+var
+  b,b2,b3,b4: byte;
+begin
+  b := 1;
+  b2 := 2;
+  b3 := 3;
+  b4 := 4;
+  t2(b);
+end;
+
+begin
+  t;
+  t3;
+end.