diff options
author | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-01-01 17:23:06 -0500 |
---|---|---|
committer | Alexandre Ganea <alexandre.ganea@ubisoft.com> | 2020-01-01 17:29:04 -0500 |
commit | 92b68c1937cd065a2fc44d18c1099de7da19b356 (patch) | |
tree | 8a47e1ae3f830532208f76092c20c05ebb6427ad /llvm/unittests/ADT/StringRefTest.cpp | |
parent | 6656e961c08393c3949412ef945ade0272b66fca (diff) | |
download | llvm-92b68c1937cd065a2fc44d18c1099de7da19b356.zip llvm-92b68c1937cd065a2fc44d18c1099de7da19b356.tar.gz llvm-92b68c1937cd065a2fc44d18c1099de7da19b356.tar.bz2 |
[polly][Support] Un-break polly tests
Previously, the polly unit tests were stuck in a infinite loop.
There was an edge case in StringRef::count() introduced by 9f6b13e5cce96066d7262d224c971d93c2724795, where an empty 'Str' would cause the function to never exit.
Also fixed usage in polly.
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/StringRefTest.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index cbb2a30..9cb24bf 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/unittests/ADT/StringRefTest.cpp @@ -509,6 +509,7 @@ TEST(StringRefTest, Count) { EXPECT_EQ(1U, Str.count("hello")); EXPECT_EQ(1U, Str.count("ello")); EXPECT_EQ(0U, Str.count("zz")); + EXPECT_EQ(0U, Str.count("")); StringRef OverlappingAbba("abbabba"); EXPECT_EQ(1U, OverlappingAbba.count("abba")); |