diff options
author | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-06 21:10:33 +0200 |
---|---|---|
committer | Vasilis Kalintiris <ehostunreach@gmail.com> | 2013-12-07 19:35:50 +0200 |
commit | 33c01702f81722b4aa17e01e83916af360b1e3f9 (patch) | |
tree | bc6d00232be5a87a1230ed1e7b7464184cb483d9 /tests/core | |
parent | 4244ce1d2933c11229a2468d4f41c58b73ed649c (diff) |
Use do_run_from_file() for test_i32_mul_semiprecise
Diffstat (limited to 'tests/core')
-rw-r--r-- | tests/core/test_i32_mul_semiprecise.in | 28 | ||||
-rw-r--r-- | tests/core/test_i32_mul_semiprecise.out | 10 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/core/test_i32_mul_semiprecise.in b/tests/core/test_i32_mul_semiprecise.in new file mode 100644 index 00000000..c7b4cb96 --- /dev/null +++ b/tests/core/test_i32_mul_semiprecise.in @@ -0,0 +1,28 @@ + + #include <stdio.h> + + typedef unsigned int uint; + + // from cube2, zlib licensed + + #define N (624) + #define M (397) + #define K (0x9908B0DFU) + + static uint state[N]; + static int next = N; + + void seedMT(uint seed) + { + state[0] = seed; + for(uint i = 1; i < N; i++) // if we do not do this precisely, at least we should coerce to int immediately, not wait + state[i] = seed = 1812433253U * (seed ^ (seed >> 30)) + i; + next = 0; + } + + int main() { + seedMT(5497); + for (int i = 0; i < 10; i++) printf("%d: %u\n", i, state[i]); + return 0; + } +
\ No newline at end of file diff --git a/tests/core/test_i32_mul_semiprecise.out b/tests/core/test_i32_mul_semiprecise.out new file mode 100644 index 00000000..261bf9a9 --- /dev/null +++ b/tests/core/test_i32_mul_semiprecise.out @@ -0,0 +1,10 @@ +0: 5497 +1: 2916432318 +2: 2502517762 +3: 3151524867 +4: 2323729668 +5: 2053478917 +6: 2409490438 +7: 848473607 +8: 691103752 +9: 3915535113 |