aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-26 13:58:30 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-26 13:58:30 -0800
commit0d18a1646a7932058b5f6127cda706970e9d2ce5 (patch)
tree0653ab1c5bded624a9d7e7e3d3d3fb54d57c76a0 /tests
parent569c804ab9dd702e3b9f255b7bcff4881021b755 (diff)
add i16 to corrections benchmark
Diffstat (limited to 'tests')
-rw-r--r--tests/runner.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 2ff97c2c..ba501372 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -4828,25 +4828,27 @@ else:
def test_corrections(self):
Settings.CORRECT_SIGNS = Settings.CORRECT_OVERFLOWS = Settings.CORRECT_ROUNDINGS = 1
- src = '''
+ src = r'''
#include<stdio.h>
#include<math.h>
int main() {
- int N = 4500;
- int M = 4500;
+ int N = 4100;
+ int M = 4100;
unsigned int f = 0;
+ unsigned short s = 0;
for (int t = 0; t < M; t++) {
for (int i = 0; i < N; i++) {
f += i / ((t % 5)+1);
if (f > 1000) f /= (t % 3)+1;
if (i % 4 == 0) f += sqrtf(i) * (i % 8 == 0 ? 1 : -1);
+ s += (short(f)*short(f)) % 256;
}
}
- printf("final: %d.\\n", f);
+ printf("final: %d:%d.\n", f, s);
return 1;
}
'''
- self.do_benchmark(src, [], 'final: 451.')
+ self.do_benchmark(src, [], 'final: 826:14324.')
def test_fasta(self):
src = open(path_from_root('tests', 'fasta.cpp'), 'r').read()