瀏覽代碼

Merged revisions 10892,10913,10924-10925,10950 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r10892 | jonas | 2008-05-06 14:26:18 +0200 (Tue, 06 May 2008) | 2 lines

+ test for mantis #6769 (already works with 2.3.1 and 2.2.1)

........
r10913 | jonas | 2008-05-09 16:13:59 +0200 (Fri, 09 May 2008) | 2 lines

* result of prefetch is voidtype, not voidpointertype (fixes mantis #11275)

........
r10924 | jonas | 2008-05-09 23:01:41 +0200 (Fri, 09 May 2008) | 3 lines

* tw9176a should fail, moved to webtbf and added { %fail }
+ added tw9176 which should succeed

........
r10925 | jonas | 2008-05-09 23:08:30 +0200 (Fri, 09 May 2008) | 2 lines

* disable second part of the test for 64 bit platforms (see comments)

........
r10950 | jonas | 2008-05-12 11:51:19 +0200 (Mon, 12 May 2008) | 2 lines

+ test I still had lying around

........

git-svn-id: branches/fixes_2_2@10965 -

Jonas Maebe 17 年之前
父節點
當前提交
5031237a01
共有 6 個文件被更改,包括 77 次插入2 次删除
  1. 4 1
      .gitattributes
  2. 2 1
      compiler/ninl.pas
  3. 15 0
      tests/tbf/tb0208.pp
  4. 4 0
      tests/webtbf/tw9176a.pp
  5. 28 0
      tests/webtbs/tw6769.pp
  6. 24 0
      tests/webtbs/tw9176.pp

+ 4 - 1
.gitattributes

@@ -6205,6 +6205,7 @@ tests/tbf/tb0202.pp svneol=native#text/plain
 tests/tbf/tb0204.pp svneol=native#text/plain
 tests/tbf/tb0204.pp svneol=native#text/plain
 tests/tbf/tb0204a.pp svneol=native#text/plain
 tests/tbf/tb0204a.pp svneol=native#text/plain
 tests/tbf/tb0205.pp svneol=native#text/plain
 tests/tbf/tb0205.pp svneol=native#text/plain
+tests/tbf/tb0208.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain
@@ -7831,6 +7832,7 @@ tests/webtbf/tw9039d.pp svneol=native#text/plain
 tests/webtbf/tw9053.pp svneol=native#text/plain
 tests/webtbf/tw9053.pp svneol=native#text/plain
 tests/webtbf/tw9072a.pp svneol=native#text/plain
 tests/webtbf/tw9072a.pp svneol=native#text/plain
 tests/webtbf/tw9072b.pp svneol=native#text/plain
 tests/webtbf/tw9072b.pp svneol=native#text/plain
+tests/webtbf/tw9176a.pp svneol=native#text/plain
 tests/webtbf/tw9225.pp svneol=native#text/plain
 tests/webtbf/tw9225.pp svneol=native#text/plain
 tests/webtbf/tw9306c.pp svneol=native#text/plain
 tests/webtbf/tw9306c.pp svneol=native#text/plain
 tests/webtbf/tw9499.pp svneol=native#text/plain
 tests/webtbf/tw9499.pp svneol=native#text/plain
@@ -8676,6 +8678,7 @@ tests/webtbs/tw6735.pp svneol=native#text/plain
 tests/webtbs/tw6737.pp -text
 tests/webtbs/tw6737.pp -text
 tests/webtbs/tw6742.pp svneol=native#text/plain
 tests/webtbs/tw6742.pp svneol=native#text/plain
 tests/webtbs/tw6767.pp svneol=native#text/plain
 tests/webtbs/tw6767.pp svneol=native#text/plain
+tests/webtbs/tw6769.pp svneol=native#text/plain
 tests/webtbs/tw6822a.pp svneol=native#text/plain
 tests/webtbs/tw6822a.pp svneol=native#text/plain
 tests/webtbs/tw6822b.pp svneol=native#text/plain
 tests/webtbs/tw6822b.pp svneol=native#text/plain
 tests/webtbs/tw6822c.pp svneol=native#text/plain
 tests/webtbs/tw6822c.pp svneol=native#text/plain
@@ -8844,7 +8847,7 @@ tests/webtbs/tw9161.pp svneol=native#text/plain
 tests/webtbs/tw9162.pp svneol=native#text/plain
 tests/webtbs/tw9162.pp svneol=native#text/plain
 tests/webtbs/tw9167.pp svneol=native#text/plain
 tests/webtbs/tw9167.pp svneol=native#text/plain
 tests/webtbs/tw9174.pp svneol=native#text/plain
 tests/webtbs/tw9174.pp svneol=native#text/plain
-tests/webtbs/tw9176a.pp -text
+tests/webtbs/tw9176.pp svneol=native#text/plain
 tests/webtbs/tw9179.pp svneol=native#text/plain
 tests/webtbs/tw9179.pp svneol=native#text/plain
 tests/webtbs/tw9187.pp svneol=native#text/plain
 tests/webtbs/tw9187.pp svneol=native#text/plain
 tests/webtbs/tw9190.pp svneol=native#text/plain
 tests/webtbs/tw9190.pp svneol=native#text/plain

+ 2 - 1
compiler/ninl.pas

@@ -2257,7 +2257,8 @@ implementation
                   if (cs_do_assertion in current_settings.localswitches) then
                   if (cs_do_assertion in current_settings.localswitches) then
                     include(current_procinfo.flags,pi_do_call);
                     include(current_procinfo.flags,pi_do_call);
                 end;
                 end;
-              in_prefetch_var,
+              in_prefetch_var:
+                resultdef:=voidtype;
               in_get_frame,
               in_get_frame,
               in_get_caller_frame,
               in_get_caller_frame,
               in_get_caller_addr:
               in_get_caller_addr:

+ 15 - 0
tests/tbf/tb0208.pp

@@ -0,0 +1,15 @@
+{ %fail }
+{ %opt=-Sew }
+
+procedure test;
+var
+  b: byte;
+begin
+  case b of
+    1: b:=1;
+  end;
+end;
+
+begin
+  test;
+end.

+ 4 - 0
tests/webtbs/tw9176a.pp → tests/webtbf/tw9176a.pp

@@ -1,4 +1,8 @@
+{ %fail }
+
+{$ifdef fpc}
 {$mode delphi}
 {$mode delphi}
+{$endif}
 
 
 type TBla=class
 type TBla=class
      bla : integer;
      bla : integer;

+ 28 - 0
tests/webtbs/tw6769.pp

@@ -0,0 +1,28 @@
+{$q+}
+{$r+}
+
+Var A, B, C : Byte;
+    D : SmallInt;
+Begin
+A := 6;
+B := 8;
+C := 20;
+D := -C+A+B;
+if (d<>-6) then
+  halt(1);
+Writeln(D);
+{$ifndef cpu64}
+{ On 32 bit systems, A+B becomes cardinal and the -C turns the expression
+  into int64 -> calculated ok.
+  On 64 bit systems, A+B becomes qword and the -C keeps it qword ->
+  overflow error. This can only be properly supported in 64 bit with the
+  introduction of a 128 bit signed type, except if we'd use a different
+  rule set in 64 bit (such as byte+byte -> cardinal and cardinal+cardinal
+  -> qword, or so)
+}
+D := A+B-C;
+if (d<>-6) then
+  halt(1);
+Writeln(D)
+{$endif cpu64}
+End.

+ 24 - 0
tests/webtbs/tw9176.pp

@@ -0,0 +1,24 @@
+{$ifdef fpc}
+{$mode delphi}
+{$endif}
+
+type TBla=class
+      procedure Bla;
+      procedure BlaBla;
+     end;
+
+procedure TBla.Bla;
+begin
+end;
+
+procedure TBla.BlaBla;
+ procedure Bla;
+ begin
+ end;
+begin
+ Bla;
+end;
+
+begin
+end.
+