Browse Source

* Explicitly disable range/overlfow checks when test is not about this

git-svn-id: trunk@20602 -
pierre 13 years ago
parent
commit
6fd24693d6

+ 3 - 0
tests/tbs/tb0488a.pp

@@ -27,6 +27,9 @@
     999999999
 }
 
+{$R-}
+{$Q-}
+
 uses {$ifdef unix}cwstring, {$endif}SysUtils,erroru;
 
 procedure Check(a,b:ansistring);

+ 1 - 1
tests/tbs/tb0496.pp

@@ -28,7 +28,7 @@ procedure tmyclass.m2;
 var
   myclass : tmyclass;
 begin
-  res:=$deadbeef;
+  res:=longint($deadbeef);
   myclass:=tmyclass.create;
   myclass.m2;
   myclass.free;

+ 3 - 0
tests/tbs/tb0543.pp

@@ -1,3 +1,6 @@
+{$R-}
+{$Q-}
+
 procedure check(l: longint; v,c: int64);
 begin
   if (v<>c) then

+ 3 - 0
tests/test/cg/taddlong.pp

@@ -5,6 +5,9 @@
 {   - if statements function correctly.                      }
 {   - subroutine calls function correctly.                   }
 
+{$R-}
+{$Q-}
+
 procedure fail;
 begin
   WriteLn('Failed!');

+ 9 - 6
tests/test/cg/tcalext3.pp

@@ -1,13 +1,16 @@
-{ Tests passing of different records by value to C methods. 
+{ Tests passing of different records by value to C methods.
  One type of these records has one field which is a simple array of bytes,
  the other consists of a few fields of atomic size.
- 
+
  Note that it does not only test a single field of these records, but all
  by comparing the sum of the field values with the sum returned by the
  C function.
 }
+
 program calext3;
 {$MODE DELPHI}
+{$R-}
+{$Q-}
 
 type
   int8_t = shortint;
@@ -122,7 +125,7 @@ type
     v1 : int32_t;
     v2 : int16_t;
   end;
-  
+
   struct7 = record
     v1 : int32_t;
     v2 : int16_t;
@@ -165,8 +168,8 @@ type
     v2 : int32_t;
     v3 : int16_t;
   end;
-  
-  struct15 = record 
+
+  struct15 = record
     v1 : int64_t;
     v2 : int32_t;
     v3 : int16_t;
@@ -517,7 +520,7 @@ var
   sa31 : struct_arr31;
   sa32 : struct_arr32;
   sa33 : struct_arr33;
-  
+
   s1 : struct1;
   s2 : struct2;
   s3 : struct3;

+ 17 - 15
tests/test/cg/tcalext4.pp

@@ -1,6 +1,8 @@
 { Tests passing of byte arrays by value of different sizes to C methods }
 program passvaluestest;
 {$MODE DELPHI}
+{$R-}
+{$Q-}
 type
   int8_t = shortint;
   pint8_t = ^int8_t;
@@ -12,20 +14,20 @@ var
 
 type
   arr1 = array[1..1] of int8_t;
-  arr2 = array[1..2] of int8_t;  
-  arr3 = array[1..3] of int8_t;  
-  arr4 = array[1..4] of int8_t;  
-  arr5 = array[1..5] of int8_t;  
-  arr7 = array[1..7] of int8_t;  
-  arr8 = array[1..8] of int8_t;  
-  arr9 = array[1..9] of int8_t;  
-  arr15 = array[1..15] of int8_t;  
-  arr16 = array[1..16] of int8_t;  
-  arr17 = array[1..17] of int8_t;  
-  arr24 = array[1..24] of int8_t;  
-  arr31 = array[1..31] of int8_t;  
-  arr32 = array[1..32] of int8_t;  
-  arr33 = array[1..33] of int8_t;  
+  arr2 = array[1..2] of int8_t;
+  arr3 = array[1..3] of int8_t;
+  arr4 = array[1..4] of int8_t;
+  arr5 = array[1..5] of int8_t;
+  arr7 = array[1..7] of int8_t;
+  arr8 = array[1..8] of int8_t;
+  arr9 = array[1..9] of int8_t;
+  arr15 = array[1..15] of int8_t;
+  arr16 = array[1..16] of int8_t;
+  arr17 = array[1..17] of int8_t;
+  arr24 = array[1..24] of int8_t;
+  arr31 = array[1..31] of int8_t;
+  arr32 = array[1..32] of int8_t;
+  arr33 = array[1..33] of int8_t;
 
 procedure fill(var mem; size : integer);
 var
@@ -54,7 +56,7 @@ var
  i : Integer;
 begin
   result := 0;
-  for i := low(s) to high(s) do 
+  for i := low(s) to high(s) do
     inc(result, s[i]);
 end;
 

+ 9 - 7
tests/test/cg/tcalext5.pp

@@ -1,13 +1,15 @@
-{ Tests passing of different records by value to C methods. 
+{ Tests passing of different records by value to C methods.
  One type of these records has one field which is a simple array of bytes,
  the other consists of a few fields of atomic size.
- 
+
  Note that it does not only test a single field of these records, but all
  by comparing the sum of the field values with the sum returned by the
  C function.
 }
 program calext3;
 {$MODE DELPHI}
+{$R-}
+{$Q-}
 
 { requires libgcc for the C functions }
 {$ifdef FPUSOFT}
@@ -127,7 +129,7 @@ type
     v1 : int32_t;
     v2 : int16_t;
   end;
-  
+
   struct7 = record
     v1 : int32_t;
     v2 : int16_t;
@@ -170,8 +172,8 @@ type
     v2 : int32_t;
     v3 : int16_t;
   end;
-  
-  struct15 = record 
+
+  struct15 = record
     v1 : int64_t;
     v2 : int32_t;
     v3 : int16_t;
@@ -526,7 +528,7 @@ var
   sa31 : struct_arr31;
   sa32 : struct_arr32;
   sa33 : struct_arr33;
-  
+
   s1 : struct1;
   s2 : struct2;
   s3 : struct3;
@@ -543,7 +545,7 @@ var
   s14 : struct14;
   s15 : struct15;
   s31 : struct31;
-  
+
   c: cardinal;
 
 begin

+ 2 - 1
tests/test/cg/tcnvint5.pp

@@ -1,5 +1,6 @@
 
-{ This test requires overflow check to be off }
+{ This test requires overflow and range check to be off }
+{$R-}
 {$Q-}
 
 var

+ 2 - 1
tests/test/cg/tcnvint6.pp

@@ -1,6 +1,7 @@
 
-{ This test requires overflow check to be off }
+{ This test requires overflow and range check to be off }
 {$Q-}
+{$R-}
 
 procedure error(n: longint);
 begin

+ 1 - 1
tests/test/tprec6.pp

@@ -6,7 +6,7 @@ Uses uprec6;
 Var I,J:Integer;
     APackedBoolean:TPackedBoolean;
 Begin
- writeln(sizeof(APackedBoolean[0]));
+// writeln(sizeof(APackedBoolean[0])); Index is 1..5 range
  writeln(sizeof(APackedBoolean[1]));
 // writeln(ptruint(@APackedBoolean[1])-ptruint(@APackedBoolean[0]));
 // writeln(ptruint(@APackedBoolean[2])-ptruint(@APackedBoolean[1]));

+ 3 - 0
tests/test/trox1.pp

@@ -1,3 +1,6 @@
+{$Q-}
+{$R-}
+
 procedure do_error(i : integer);
   begin
     writeln('Error: ',i);

+ 3 - 0
tests/test/trox2.pp

@@ -1,3 +1,6 @@
+{$Q-}
+{$R-}
+
 // tests whether the rol/ror operations properly mask out the shift count
 procedure do_error(i : integer);
   begin

+ 3 - 0
tests/test/trox3.pp

@@ -1,3 +1,6 @@
+{$Q-}
+{$R-}
+
 procedure do_error(i : integer);
   begin
     writeln('Error: ',i);

+ 3 - 0
tests/test/trox4.pp

@@ -1,3 +1,6 @@
+{$Q-}
+{$R-}
+
 // tests whether the rol/ror operations properly mask out the shift count
 procedure do_error(i : integer);
   begin

+ 3 - 0
tests/webtbs/tw3360.pp

@@ -1,6 +1,9 @@
 { Source provided for Free Pascal Bug Report 3360 }
 { Submitted by "Thomas Schatzl" on  2004-10-17 }
 { e-mail:  }
+{$R-}
+{$Q-}
+
 type
         tdef = record
           f1 : longint;

+ 3 - 0
tests/webtbs/tw3478.pp

@@ -27,6 +27,9 @@
     999999999
 }
 
+{$R-}
+{$Q-}
+
 uses SysUtils,erroru;
 
 procedure Check(a,b:ansistring);

+ 3 - 0
tests/webtbs/tw3973.pp

@@ -3,6 +3,9 @@
 { e-mail: [email protected] }
 program fpc_test_3;
 
+{$R-}
+{$Q-}
+
 {$APPTYPE CONSOLE}
 
 {$IFDEF FPC}

+ 1 - 0
tests/webtbs/tw4043.pp

@@ -1,4 +1,5 @@
 { %target=win32 }
+{ %OPT=-Cr- }
 
 uses
   windows;