Regression test for live range bug for call arguments.
[oota-llvm.git] / test / LLC / poisson.c
1 /* For copyright information, see olden_v1.0/COPYRIGHT */
2
3 /**********************************************************
4  * poisson.c: handles math routines for health.c          *
5  **********************************************************/
6
7 #include <stdio.h>
8 #include <math.h>
9
10 /* From health.h */
11 #define IA 16807
12 #define IM 2147483647
13 #define AM (1.0 / IM)
14 #define IQ 127773
15 #define IR 2836
16 #define MASK 123459876
17
18 float my_rand(long idum) 
19 {
20   long  k;
21   float answer;
22   
23   idum ^= MASK;
24   k = idum / IQ;
25   idum = IA * (idum - k * IQ) - IR * k;
26   idum ^= MASK;
27   if (idum < 0) 
28     idum  += IM;
29   answer = AM * idum;
30   return answer; 
31 }
32
33 int
34 main(int argc, char** argv)
35 {
36   printf("my_rand(%d) = %g\n", 2555540, my_rand(2555540));
37   printf("my_rand(%d) = %g\n", 2427763, my_rand(2427763));
38   return 0;
39 }
40
41