Browse Source

* Fix tests for constexprint rework.

git-svn-id: trunk@7638 -
daniel 18 years ago
parent
commit
02732bfb55
3 changed files with 10 additions and 6 deletions
  1. 1 1
      tests/tbf/tb0171.pp
  2. 1 1
      tests/tbf/tb0172.pp
  3. 8 4
      tests/test/cg/tadint64.pp

+ 1 - 1
tests/tbf/tb0171.pp

@@ -1,7 +1,7 @@
 { %fail }
 { %fail }
 
 
 const
 const
-  c1 = high(int64)-1;
+  c1 = high(qword)-1;
   { Overflow }
   { Overflow }
   c2 = c1+2;
   c2 = c1+2;
 begin
 begin

+ 1 - 1
tests/tbf/tb0172.pp

@@ -1,7 +1,7 @@
 { %fail }
 { %fail }
 
 
 const
 const
-  c1 = high(int64)-1;
+  c1 = high(qword)-1;
   { Overflow }
   { Overflow }
   c2 = c1*2;
   c2 = c1*2;
 begin
 begin

+ 8 - 4
tests/test/cg/tadint64.pp

@@ -415,9 +415,10 @@ begin
  if j <> k then
  if j <> k then
    result := false;
    result := false;
 
 
- { The next statement would create an range check error }
- {$R-}
- if j <> (1000000000-(qword(1000000000) * 10)) then
+ { Since qword variable<>negative constant is always false according to the 
+   compiler (allowing it to optimize the if away) we need to do a preventive
+   typecast to qword.}
+ if j <> qword(1000000000-(qword(1000000000) * 10)) then
    result := false;
    result := false;
  j := (qword(1) shl 33);
  j := (qword(1) shl 33);
  i := (qword(1) shl 34) - j;
  i := (qword(1) shl 34) - j;
@@ -425,7 +426,10 @@ begin
    result := false;
    result := false;
 
 
  i := 1 - j;
  i := 1 - j;
- if (i <> (1-(qword(1) shl 33))) then
+ { Since qword variable<>negative constant is always false according to the 
+   compiler (allowing it to optimize the if away) we need to do a preventive
+   typecast to qword.}
+ if i <> qword(1-(qword(1) shl 33)) then
    result := false;
    result := false;
 
 
  i := 100000;
  i := 100000;