Disable optimization that doesn't apply to C
[oota-llvm.git] / test / LLC / varargs.c
1 #include <stdio.h>
2 #include <stdlib.h>
3
4 #define A       16807.0
5 #define M       2147483647.0
6
7 /*
8  * This function calls floor() which does not have a prototype.
9  * Test that the argument to floor is passed correctly.
10  */
11 double
12 my_rand(double seed)
13 {
14     double t = A*seed  + 1; 
15     double floor();
16
17     seed = t - (M * floor(t / M));      /* t%M if t > M; t otherwise */
18     return seed;
19
20 } /* end of random */
21
22
23 int
24 main(int argc, char** argv)
25 {
26   double seed = 123 * ((argc > 1)? atof(argv[1]) : 3.1415926);
27   printf("my_rand(%lf) = %lf\n", seed, my_rand(seed));
28   return 0;
29 }