Browse Source

Add explicit $R- or $Q- to avoid different results if -Criot option is used

git-svn-id: trunk@34010 -
pierre 9 years ago
parent
commit
df7e562d94

+ 1 - 1
.gitattributes

@@ -14993,7 +14993,7 @@ tests/webtbs/tw28271.pp svneol=native#text/pascal
 tests/webtbs/tw28279.pp svneol=native#text/plain
 tests/webtbs/tw2829.pp svneol=native#text/plain
 tests/webtbs/tw2830.pp svneol=native#text/plain
-tests/webtbs/tw28313.pp -text svneol=native#text/plain
+tests/webtbs/tw28313.pp svneol=native#text/plain
 tests/webtbs/tw2832.pp svneol=native#text/plain
 tests/webtbs/tw2834.pp svneol=native#text/plain
 tests/webtbs/tw28372.pp svneol=native#text/plain

+ 5 - 0
tests/tbs/tb0602.pp

@@ -1,3 +1,8 @@
+{ This test explicity generates
+  dec(w,2) with w=1 of unsigned type word,
+  this generates range check error.
+  Thus, we need an explicit $R- }
+{$R-}
 {$ifdef fpc}
 {$mode delphi}
 {$endif}

+ 4 - 0
tests/test/tmul1.pp

@@ -1,3 +1,7 @@
+{ This test explicity generates overflow.
+  Thus, we need explicit $Q- }
+{$Q-}
+
 var
   i : longint;
 

+ 7 - 2
tests/webtbs/tw11791.pp

@@ -1402,9 +1402,14 @@ begin
           SetLength(LineBuffer2,4096);
 
           tmpwide:=UTF8Decode(LineBuffer);
-          
+
           // UnicodeToUTF8 includes terminating #0 -> length-1
-          setlength(LineBuffer2,UnicodeToUTF8(@LineBuffer2[1],length(LineBuffer2),punicodechar(@tmpwide[1]),length(tmpwide))-1);
+
+          if length(tmpwide)>0 then
+            setlength(LineBuffer2,UnicodeToUTF8(@LineBuffer2[1],length(LineBuffer2),punicodechar(@tmpwide[1]),length(tmpwide))-1)
+          else
+            setlength(LineBuffer2,0);
+
           cnvwide:=UTF8Decode(LineBuffer2);
           if (cnvwide <> tmpwide) then
             begin

+ 3 - 0
tests/webtbs/tw24796.pp

@@ -1,3 +1,6 @@
+{ This test explicity generates calculations which overflow.
+  Thus, we need an explicit $Q- }
+{$Q-}
 {$apptype console}
 {$mode objfpc}
 {$inline on}

+ 5 - 0
tests/webtbs/tw25081.pp

@@ -1,3 +1,8 @@
+{ This test explicity generates overflow and range check error
+  Thus, we need explicit $Q- and $R- }
+{$Q-}
+{$R-}
+
 program tw25081;
 
 {$APPTYPE CONSOLE}

+ 25 - 20
tests/webtbs/tw28313.pp

@@ -1,20 +1,25 @@
-program project1;
-
-{$mode delphi}{$H+}
-
-uses
-  Classes;
-
-var
-   mode:integer;
-   tabs:TStrings;
-begin
-   tabs:=TStringList.Create;
-   mode:=0;
-   try
-    if not (Mode in [0..Tabs.Count-1]) then exit;
-   finally
-     tabs.Free;
-   end;
-end.
-
+{ This test explicity generates a range check error
+  in Tab.Count (which is zero) -1
+  as upper range in set.
+  Thus, we need an explicit $R- }
+{$R-}
+program project1;
+
+{$mode delphi}{$H+}
+
+uses
+  Classes;
+
+var
+   mode:integer;
+   tabs:TStrings;
+begin
+   tabs:=TStringList.Create;
+   mode:=0;
+   try
+    if not (Mode in [0..Tabs.Count-1]) then exit;
+   finally
+     tabs.Free;
+   end;
+end.
+

+ 6 - 0
tests/webtbs/tw29620.pp

@@ -1,3 +1,9 @@
+{ This test explicity checks results
+  of qword multiplication for which overflow happens.
+  Thus, we need an explicit $Q- }
+
+{$Q-}
+
 var x:uint64;
     y:longword;
 begin

+ 6 - 0
tests/webtbs/tw29906.pp

@@ -1,3 +1,9 @@
+{ This test explicity generates calculation with
+  results outside tsub range, so range checks
+  generate errors.
+  Thus, we need an explicit $R- }
+{$R-}
+
 {$mode objfpc}
 
 type

+ 5 - 0
tests/webtbs/tw3864.pp

@@ -1,3 +1,8 @@
+{ Explictly disable range check as the test
+  is not about this but does generate a range check error
+  for the index of rasteriso array }
+{$R-}
+
 { Source provided for Free Pascal Bug Report 3864 }
 { Submitted by "Jernej" on  2005-04-01 }
 { e-mail: [email protected] }