[libc-commits] [libc] [libc][test] make `str_to_float_comparison_test` independent of C++ headers. (PR #133978)

Mikhail R. Gadelha via libc-commits libc-commits at lists.llvm.org
Sat Apr 5 08:18:58 PDT 2025


================
@@ -54,80 +56,112 @@ static inline uint64_t fastHexToU64(const char *inStr) {
   return result;
 }
 
-int checkFile(char *inputFileName, int *totalFails, int *totalBitDiffs,
-              int *detailedBitDiffs, int *total) {
-  int32_t curFails = 0;    // Only counts actual failures, not bitdiffs.
-  int32_t curBitDiffs = 0; // A bitdiff is when the expected result and actual
-                           // result are off by +/- 1 bit.
-  std::string line;
-  std::string num;
+static void parseLine(char *line, int *total, int *detailedBitDiffs,
+                      int32_t &curFails, int32_t &curBitDiffs) {
 
-  std::ifstream fileStream(inputFileName, std::ifstream::in);
-
-  if (!fileStream.is_open()) {
-    std::cout << "file '" << inputFileName << "' failed to open. Exiting.\n";
-    return 1;
+  if (line[0] == '#') {
----------------
mikhailramalho wrote:

you can remove this check

https://github.com/llvm/llvm-project/pull/133978


More information about the libc-commits mailing list