diff options
Diffstat (limited to 'tests/runner.py')
-rw-r--r-- | tests/runner.py | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/tests/runner.py b/tests/runner.py index e53dde28..fa6a3d69 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -4641,33 +4641,35 @@ Child2:9 } ''' - Settings.CORRECT_ROUNDINGS = 0 - self.do_run(src.replace('TYPE', 'long long'), '*-3**2**-6**5*') # JS floor operations, always to the negative. This is an undetected error here! - self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') # We get these right, since they are 32-bit and we can shortcut using the |0 trick - self.do_run(src.replace('TYPE', 'unsigned int'), '*-3**2**-6**5*') # We fail, since no fast shortcut for 32-bit unsigneds + if Settings.I64_MODE == 0: # the errors here are very specific to non-i64 mode 1 + Settings.CORRECT_ROUNDINGS = 0 + self.do_run(src.replace('TYPE', 'long long'), '*-3**2**-6**5*') # JS floor operations, always to the negative. This is an undetected error here! + self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') # We get these right, since they are 32-bit and we can shortcut using the |0 trick + self.do_run(src.replace('TYPE', 'unsigned int'), '*-3**2**-6**5*') # We fail, since no fast shortcut for 32-bit unsigneds Settings.CORRECT_ROUNDINGS = 1 + Settings.CORRECT_SIGNS = 1 # To be correct here, we need sign corrections as well self.do_run(src.replace('TYPE', 'long long'), '*-2**2**-5**5*') # Correct self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') # Correct - Settings.CORRECT_SIGNS = 1 # To be correct here, we need sign corrections as well self.do_run(src.replace('TYPE', 'unsigned int'), '*2147483645**2**-5**5*') # Correct - return Settings.CORRECT_SIGNS = 0 - Settings.CORRECT_ROUNDINGS = 2 - Settings.CORRECT_ROUNDINGS_LINES = ["src.cpp:13"] # Fix just the last mistake - self.do_run(src.replace('TYPE', 'long long'), '*-3**2**-5**5*') - self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') # Here we are lucky and also get the first one right - self.do_run(src.replace('TYPE', 'unsigned int'), '*-3**2**-5**5*') # No such luck here + if Settings.I64_MODE == 0: # the errors here are very specific to non-i64 mode 1 + Settings.CORRECT_ROUNDINGS = 2 + Settings.CORRECT_ROUNDINGS_LINES = ["src.cpp:13"] # Fix just the last mistake + self.do_run(src.replace('TYPE', 'long long'), '*-3**2**-5**5*') + self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') # Here we are lucky and also get the first one right + self.do_run(src.replace('TYPE', 'unsigned int'), '*-3**2**-5**5*') # No such luck here # And reverse the check with = 2 - Settings.CORRECT_ROUNDINGS = 3 - Settings.CORRECT_ROUNDINGS_LINES = ["src.cpp:999"] - self.do_run(src.replace('TYPE', 'long long'), '*-2**2**-5**5*') - self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') - Settings.CORRECT_SIGNS = 1 # To be correct here, we need sign corrections as well - self.do_run(src.replace('TYPE', 'unsigned int'), '*2147483645**2**-5**5*') - Settings.CORRECT_SIGNS = 0 + if Settings.I64_MODE == 0: # the errors here are very specific to non-i64 mode 1 + Settings.CORRECT_ROUNDINGS = 3 + Settings.CORRECT_ROUNDINGS_LINES = ["src.cpp:999"] + self.do_run(src.replace('TYPE', 'long long'), '*-2**2**-5**5*') + self.do_run(src.replace('TYPE', 'int'), '*-2**2**-5**5*') + Settings.CORRECT_SIGNS = 1 # To be correct here, we need sign corrections as well + self.do_run(src.replace('TYPE', 'unsigned int'), '*2147483645**2**-5**5*') + Settings.CORRECT_SIGNS = 0 def test_pgo(self): Settings.PGO = Settings.CHECK_OVERFLOWS = Settings.CORRECT_OVERFLOWS = Settings.CHECK_SIGNS = Settings.CORRECT_SIGNS = 1 |