diff --git a/llvm/unittests/FileCheck/FileCheckTest.cpp b/llvm/unittests/FileCheck/FileCheckTest.cpp --- a/llvm/unittests/FileCheck/FileCheckTest.cpp +++ b/llvm/unittests/FileCheck/FileCheckTest.cpp @@ -8,6 +8,7 @@ #include "llvm/FileCheck/FileCheck.h" #include "../lib/FileCheck/FileCheckImpl.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/Regex.h" #include "llvm/Testing/Support/Error.h" #include "gtest/gtest.h" @@ -100,9 +101,9 @@ std::string MaxUint64Str; std::string MaxInt64Str; std::string MinInt64Str; - StringRef FirstInvalidCharDigits; + SmallVector FirstInvalidCharDigits; StringRef AcceptedHexOnlyDigits; - StringRef RefusedHexOnlyDigits; + SmallVector RefusedHexOnlyDigits; SourceMgr SM; @@ -121,8 +122,7 @@ MinInt64Str = std::to_string(MinInt64); TenStr = "10"; FifteenStr = "15"; - FirstInvalidCharDigits = "aA"; - AcceptedHexOnlyDigits = RefusedHexOnlyDigits = "N/A"; + FirstInvalidCharDigits = {'a', 'A'}; return; } @@ -131,9 +131,12 @@ TenStr = AllowUpperHex ? "A" : "a"; FifteenStr = AllowUpperHex ? "F" : "f"; AcceptedHexOnlyDigits = AllowUpperHex ? "ABCDEF" : "abcdef"; - RefusedHexOnlyDigits = AllowUpperHex ? "abcdef" : "ABCDEF"; + if (AllowUpperHex) + RefusedHexOnlyDigits = {'a', 'b', 'c', 'd', 'e', 'f'}; + else + RefusedHexOnlyDigits = {'A', 'B', 'C', 'D', 'E', 'F'}; MinInt64Str = "N/A"; - FirstInvalidCharDigits = "gG"; + FirstInvalidCharDigits = {'g', 'G'}; } void checkWildcardRegexMatch(StringRef Input, @@ -152,7 +155,7 @@ EXPECT_FALSE(WildcardRegex.match(Input)); } - void checkWildcardRegexCharMatchFailure(StringRef Chars) const { + void checkWildcardRegexCharMatchFailure(SmallVectorImpl &Chars) const { for (auto C : Chars) EXPECT_FALSE(WildcardRegex.match(StringRef(&C, 1))); }