Add int ferror(FILE *)

llvm-svn: 14194
diff --git a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
index 456b09f6..2299874 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
+++ b/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp
@@ -636,6 +636,14 @@
   return GV;
 }
 
+// int ferror (FILE *stream);
+GenericValue lle_X_ferror(FunctionType *M, const vector<GenericValue> &Args) {
+  assert(Args.size() == 1);
+  GenericValue GV;
+  GV.IntVal = ferror (getFILE(GVTOP(Args[0])));
+  return GV;
+}
+
 // int fprintf(FILE *,sbyte *, ...) - a very rough implementation to make output
 // useful.
 GenericValue lle_X_fprintf(FunctionType *M, const vector<GenericValue> &Args) {