Fix chrome autorollers
Fix warning raised by the compiler being too smart for its own good:
error: loop will run at most once (loop increment never executed) [-Werror,-Wunreachable-code-loop-increment]
Bug: b/153194656
Change-Id: Idca543c13213c6e0bd2d1ff2fdbaa48348f53bf2
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/43989
Tested-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/tests/SystemUnitTests/LRUCacheTests.cpp b/tests/SystemUnitTests/LRUCacheTests.cpp
index 1f3f6b6..fe684e2 100644
--- a/tests/SystemUnitTests/LRUCacheTests.cpp
+++ b/tests/SystemUnitTests/LRUCacheTests.cpp
@@ -46,9 +46,14 @@
LRUCache<std::string, std::string> cache(8);
ASSERT_EQ(cache.lookup(""), "");
ASSERT_EQ(cache.lookup("123"), "");
+ bool looped = false;
for(auto ignored : cache)
{
(void)ignored;
+ looped = true;
+ }
+ if(looped)
+ {
FAIL() << "Should not loop on empty cache";
}
}