diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-10 21:54:05 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-07-10 21:54:05 +0000 |
| commit | 253d9e40a22a446e1137926f27803830faf17fd7 (patch) | |
| tree | 3f5a0ba22bacb73ee17baf226e58436767f0db64 /llvm/test/Regression/LLC/poisson.c | |
| parent | 72623d57e4063452426e70c8a771a8f7f8d12b28 (diff) | |
| download | bcm5719-llvm-253d9e40a22a446e1137926f27803830faf17fd7.tar.gz bcm5719-llvm-253d9e40a22a446e1137926f27803830faf17fd7.zip | |
Some of these are feature tests, not regression tests.
This directory needs to be reorganized and some of the tests
need changes to make them executable. Also comments would help...
llvm-svn: 2865
Diffstat (limited to 'llvm/test/Regression/LLC/poisson.c')
| -rw-r--r-- | llvm/test/Regression/LLC/poisson.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/llvm/test/Regression/LLC/poisson.c b/llvm/test/Regression/LLC/poisson.c new file mode 100644 index 00000000000..7d9289d9c29 --- /dev/null +++ b/llvm/test/Regression/LLC/poisson.c @@ -0,0 +1,41 @@ +/* For copyright information, see olden_v1.0/COPYRIGHT */ + +/********************************************************** + * poisson.c: handles math routines for health.c * + **********************************************************/ + +#include <stdio.h> +#include <math.h> + +/* From health.h */ +#define IA 16807 +#define IM 2147483647 +#define AM (1.0 / IM) +#define IQ 127773 +#define IR 2836 +#define MASK 123459876 + +float my_rand(long idum) +{ + long k; + float answer; + + idum ^= MASK; + k = idum / IQ; + idum = IA * (idum - k * IQ) - IR * k; + idum ^= MASK; + if (idum < 0) + idum += IM; + answer = AM * idum; + return answer; +} + +int +main(int argc, char** argv) +{ + printf("my_rand(%d) = %g\n", 2555540, my_rand(2555540)); + printf("my_rand(%d) = %g\n", 2427763, my_rand(2427763)); + return 0; +} + + |

