|
@@ -265,7 +265,6 @@ type
|
|
Procedure TestIntegerTypecasts;
|
|
Procedure TestIntegerTypecasts;
|
|
Procedure TestInteger_BitwiseShrNativeInt;
|
|
Procedure TestInteger_BitwiseShrNativeInt;
|
|
Procedure TestInteger_BitwiseShlNativeInt;
|
|
Procedure TestInteger_BitwiseShlNativeInt;
|
|
- Procedure TestInteger_BitwiseShlNativeIntWarn;
|
|
|
|
Procedure TestCurrency;
|
|
Procedure TestCurrency;
|
|
Procedure TestForBoolDo;
|
|
Procedure TestForBoolDo;
|
|
Procedure TestForIntDo;
|
|
Procedure TestForIntDo;
|
|
@@ -6443,24 +6442,27 @@ begin
|
|
StartProgram(false);
|
|
StartProgram(false);
|
|
Add([
|
|
Add([
|
|
'var',
|
|
'var',
|
|
- ' i: nativeint;',
|
|
|
|
|
|
+ ' i,j: nativeint;',
|
|
'begin',
|
|
'begin',
|
|
' i:=i shr 0;',
|
|
' i:=i shr 0;',
|
|
' i:=i shr 1;',
|
|
' i:=i shr 1;',
|
|
' i:=i shr 3;',
|
|
' i:=i shr 3;',
|
|
' i:=i shr 54;',
|
|
' i:=i shr 54;',
|
|
|
|
+ ' i:=j shr i;',
|
|
'']);
|
|
'']);
|
|
ConvertProgram;
|
|
ConvertProgram;
|
|
CheckResolverUnexpectedHints;
|
|
CheckResolverUnexpectedHints;
|
|
CheckSource('TestInteger_BitwiseShrNativeInt',
|
|
CheckSource('TestInteger_BitwiseShrNativeInt',
|
|
LinesToStr([
|
|
LinesToStr([
|
|
'this.i = 0;',
|
|
'this.i = 0;',
|
|
|
|
+ 'this.j = 0;',
|
|
'']),
|
|
'']),
|
|
LinesToStr([
|
|
LinesToStr([
|
|
'$mod.i = $mod.i;',
|
|
'$mod.i = $mod.i;',
|
|
'$mod.i = Math.floor($mod.i / 2);',
|
|
'$mod.i = Math.floor($mod.i / 2);',
|
|
'$mod.i = Math.floor($mod.i / 8);',
|
|
'$mod.i = Math.floor($mod.i / 8);',
|
|
'$mod.i = 0;',
|
|
'$mod.i = 0;',
|
|
|
|
+ '$mod.i = rtl.shr($mod.j, $mod.i);',
|
|
'']));
|
|
'']));
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -6474,6 +6476,7 @@ begin
|
|
' i:=i shl 0;',
|
|
' i:=i shl 0;',
|
|
' i:=i shl 54;',
|
|
' i:=i shl 54;',
|
|
' i:=123456789012 shl 1;',
|
|
' i:=123456789012 shl 1;',
|
|
|
|
+ ' i:=i shl 1;',
|
|
'']);
|
|
'']);
|
|
ConvertProgram;
|
|
ConvertProgram;
|
|
CheckResolverUnexpectedHints;
|
|
CheckResolverUnexpectedHints;
|
|
@@ -6485,29 +6488,10 @@ begin
|
|
'$mod.i = $mod.i;',
|
|
'$mod.i = $mod.i;',
|
|
'$mod.i = 0;',
|
|
'$mod.i = 0;',
|
|
'$mod.i = 246913578024;',
|
|
'$mod.i = 246913578024;',
|
|
|
|
+ '$mod.i = rtl.shl($mod.i, 1);',
|
|
'']));
|
|
'']));
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TTestModule.TestInteger_BitwiseShlNativeIntWarn;
|
|
|
|
-begin
|
|
|
|
- StartProgram(false);
|
|
|
|
- Add([
|
|
|
|
- 'var',
|
|
|
|
- ' i: nativeint;',
|
|
|
|
- 'begin',
|
|
|
|
- ' i:=i shl 3;',
|
|
|
|
- '']);
|
|
|
|
- ConvertProgram;
|
|
|
|
- CheckSource('TestInteger_BitwiseShlNativeIntWarn',
|
|
|
|
- LinesToStr([
|
|
|
|
- 'this.i = 0;',
|
|
|
|
- '']),
|
|
|
|
- LinesToStr([
|
|
|
|
- '$mod.i = $mod.i << 3;',
|
|
|
|
- '']));
|
|
|
|
- CheckHint(mtWarning,nBitWiseOperationIs32Bit,sBitWiseOperationIs32Bit);
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
procedure TTestModule.TestCurrency;
|
|
procedure TTestModule.TestCurrency;
|
|
begin
|
|
begin
|
|
StartProgram(false);
|
|
StartProgram(false);
|