mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 07:43:04 +01:00 
			
		
		
		
	+problem with small const sets !
This commit is contained in:
		
							parent
							
								
									8064542fa2
								
							
						
					
					
						commit
						bab0edbe32
					
				
							
								
								
									
										39
									
								
								bugs/bug0258.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								bugs/bug0258.pp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,39 @@
 | 
			
		||||
program test_set;
 | 
			
		||||
 | 
			
		||||
var error : boolean;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
procedure test;
 | 
			
		||||
 | 
			
		||||
   var
 | 
			
		||||
      i : longint;
 | 
			
		||||
      x : array [1..32] of byte;
 | 
			
		||||
 | 
			
		||||
   begin
 | 
			
		||||
      error:=false;
 | 
			
		||||
      for i:=1 to 32 do x[i]:=$ff;
 | 
			
		||||
      i:=1;
 | 
			
		||||
      if i in [1,3,5,8,11,14,15] then
 | 
			
		||||
        writeln('1 is in [1,3,5,8,11,14,15]')
 | 
			
		||||
      else
 | 
			
		||||
        writeln('Error in set');
 | 
			
		||||
      i:=135;
 | 
			
		||||
      if i in [1,3,5,8,11,14,15] then
 | 
			
		||||
        begin
 | 
			
		||||
           writeln('Error : 135 is in [1,3,5,8,11,14,15]');
 | 
			
		||||
           error:=true;
 | 
			
		||||
        end;
 | 
			
		||||
      for i:=1 to 32 do x[i]:=0;
 | 
			
		||||
      i:=135;
 | 
			
		||||
      if i in [1,3,5,8,11,14,15] then
 | 
			
		||||
        writeln('Second try Error : 135 is in [1,3,5,8,11,14,15]')
 | 
			
		||||
      else
 | 
			
		||||
        begin
 | 
			
		||||
           if error then
 | 
			
		||||
             writeln('Result of 135 in [1,3,5,8,11,14,15] depends on x array !!');
 | 
			
		||||
        end;
 | 
			
		||||
   end;
 | 
			
		||||
 | 
			
		||||
begin
 | 
			
		||||
   test;
 | 
			
		||||
end.
 | 
			
		||||
@ -350,4 +350,4 @@ bug0245.pp   assigning pointers to address of consts is allowed (refused by BP !
 | 
			
		||||
bug0246.pp   const para can be changed without error
 | 
			
		||||
bug0252.pp   typecasting not possible within typed const
 | 
			
		||||
bug0255.pp   internal error 10 with in and function calls
 | 
			
		||||
 | 
			
		||||
bug0258.pp   bug in small const set extension to large sets
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user