mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 11:53:42 +01:00 
			
		
		
		
	* fixed constant evaluation check for negvalue+posvalue (mantis #11216)
git-svn-id: trunk@10808 -
This commit is contained in:
		
							parent
							
								
									6714fbc056
								
							
						
					
					
						commit
						2413d4b43f
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							| @ -8144,6 +8144,7 @@ tests/webtbs/tw1111.pp svneol=native#text/plain | ||||
| tests/webtbs/tw11139.pp svneol=native#text/plain | ||||
| tests/webtbs/tw11169.pp svneol=native#text/plain | ||||
| tests/webtbs/tw1117.pp svneol=native#text/plain | ||||
| tests/webtbs/tw11216.pp svneol=native#text/plain | ||||
| tests/webtbs/tw1122.pp svneol=native#text/plain | ||||
| tests/webtbs/tw1123.pp svneol=native#text/plain | ||||
| tests/webtbs/tw1124.pp svneol=native#text/plain | ||||
|  | ||||
| @ -160,7 +160,7 @@ begin | ||||
|   {Try if the result fits in an int64.} | ||||
|   if (a.signed) and (a.svalue<0) then | ||||
|     {$Q-} | ||||
|     sspace:=qword(high(int64))-qword(-a.svalue) | ||||
|     sspace:=qword(high(int64))+qword(-a.svalue) | ||||
|     {$ifdef ena_q}{$Q+}{$endif} | ||||
|   else if not a.signed and (a.uvalue>qword(high(int64))) then | ||||
|     goto try_qword | ||||
|  | ||||
							
								
								
									
										21
									
								
								tests/webtbs/tw11216.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								tests/webtbs/tw11216.pp
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,21 @@ | ||||
| program TestRC; | ||||
| {$R+} | ||||
| 
 | ||||
| var Li, Lj : Int64; | ||||
| const I = $7fffffffffffffff; | ||||
| 
 | ||||
| begin | ||||
|   if (1-I)<>(-I+1) then | ||||
|     halt(1); | ||||
| 
 | ||||
|   writeln(1-I); | ||||
|   writeln(-I+1); | ||||
| 
 | ||||
|   Li := 1-I; | ||||
|   Lj := -I + 1; | ||||
|   if Li<>Lj then | ||||
|     halt(2); | ||||
| 
 | ||||
|   if (Li<>-9223372036854775806) then | ||||
|     halt(3); | ||||
| end. | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jonas Maebe
						Jonas Maebe