[libc-commits] [libc] [libc][test] make `str_to_float_comparison_test` independent of C++ headers. (PR #133978)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed Apr 9 10:59:49 PDT 2025
================
@@ -54,120 +69,168 @@ 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;
-
- std::ifstream fileStream(inputFileName, std::ifstream::in);
+static void parseLine(const char *line, ParseResult &parseResult,
+ int32_t &curFails, int32_t &curBitDiffs) {
- if (!fileStream.is_open()) {
- std::cout << "file '" << inputFileName << "' failed to open. Exiting.\n";
- return 1;
+ if (line[0] == '#') {
----------------
michaelrj-google wrote:
nit: here and below, LLVM style is to skip the braces on single line ifs
https://llvm.org/docs/CodingStandards.html#don-t-use-braces-on-simple-single-statement-bodies-of-if-else-loop-statements
https://github.com/llvm/llvm-project/pull/133978
More information about the libc-commits
mailing list