浏览代码

* Fix tests for constexprint rework.

git-svn-id: trunk@7638 -
daniel 18 年之前
父节点
当前提交
02732bfb55
共有 3 个文件被更改,包括 10 次插入6 次删除
  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 }
 
 const
-  c1 = high(int64)-1;
+  c1 = high(qword)-1;
   { Overflow }
   c2 = c1+2;
 begin

+ 1 - 1
tests/tbf/tb0172.pp

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

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

@@ -415,9 +415,10 @@ begin
  if j <> k then
    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;
  j := (qword(1) shl 33);
  i := (qword(1) shl 34) - j;
@@ -425,7 +426,10 @@ begin
    result := false;
 
  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;
 
  i := 100000;