[llvm] [flang-rt] Fix for TIMEF test case hanging on Windows (PR #195651)

Eugene Epshteyn via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 06:36:56 PDT 2026


================
@@ -41,8 +41,11 @@ TEST(TimeIntrinsics, Timef) {
   // Loop until we get a different value from Timef. If we don't get one
   // before we time out, then we should probably look into an implementation
   // for Timef with a better timer resolution.
-  // By default, this loop should burn for 1 second.
-  for (end = start; end == start; end = RTNAME(Timef)()) {
+  // By default, this loop should burn for 1 second or until the end of
+  // the iteration count.
+  int max_iterations{10000000};
+  for (int iter = 0, end = start; end == start && iter < max_iterations;
----------------
eugeneepshteyn wrote:

So `end` is now `int`? Let's declare `int iter{0}` outside the loop to avoid accidentally defining shadow variables.

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


More information about the llvm-commits mailing list