diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-10-27 23:03:44 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-10-27 23:03:44 +0000 |
commit | f9676539bbc634c8d260e7d8d414895413e28998 (patch) | |
tree | 35cf95bb15d8e90938c4cecdc7249664d4b89080 /llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | |
parent | c8c272ffb164154ec9589eacefa097718d535e2e (diff) | |
download | llvm-f9676539bbc634c8d260e7d8d414895413e28998.zip llvm-f9676539bbc634c8d260e7d8d414895413e28998.tar.gz llvm-f9676539bbc634c8d260e7d8d414895413e28998.tar.bz2 |
Changes to support rand48 tests
llvm-svn: 17284
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp')
-rw-r--r-- | llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp index def406a..2f3469c 100644 --- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp +++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp @@ -213,6 +213,8 @@ GenericValue lle_X_floor(FunctionType *M, const vector<GenericValue> &Args) { return GV; } +#ifdef HAVE_RAND48 + // double drand48() GenericValue lle_X_drand48(FunctionType *M, const vector<GenericValue> &Args) { assert(Args.size() == 0); @@ -236,6 +238,16 @@ GenericValue lle_X_srand48(FunctionType *M, const vector<GenericValue> &Args) { return GenericValue(); } +#endif + +// int rand() +GenericValue lle_X_rand(FunctionType *M, const vector<GenericValue> &Args) { + assert(Args.size() == 0); + GenericValue GV; + GV.IntVal = rand(); + return GV; +} + // void srand(uint) GenericValue lle_X_srand(FunctionType *M, const vector<GenericValue> &Args) { assert(Args.size() == 1); @@ -676,9 +688,12 @@ void Interpreter::initializeExternalFunctions() { FuncNames["lle_X_log"] = lle_X_log; FuncNames["lle_X_floor"] = lle_X_floor; FuncNames["lle_X_srand"] = lle_X_srand; + FuncNames["lle_X_rand"] = lle_X_rand; +#ifdef HAVE_RAND48 FuncNames["lle_X_drand48"] = lle_X_drand48; FuncNames["lle_X_srand48"] = lle_X_srand48; FuncNames["lle_X_lrand48"] = lle_X_lrand48; +#endif FuncNames["lle_X_sqrt"] = lle_X_sqrt; FuncNames["lle_X_puts"] = lle_X_puts; FuncNames["lle_X_printf"] = lle_X_printf; |