diff --git a/lib/Support/CachePruning.cpp b/lib/Support/CachePruning.cpp index 303ad219746..57342288e7d 100644 --- a/lib/Support/CachePruning.cpp +++ b/lib/Support/CachePruning.cpp @@ -94,7 +94,7 @@ llvm::parseCachePruningPolicy(StringRef PolicyStr) { Policy.MaxSizePercentageOfAvailableSpace = Size; } else if (Key == "cache_size_bytes") { uint64_t Mult = 1; - switch (Value.back()) { + switch (tolower(Value.back())) { case 'k': Mult = 1024; Value = Value.drop_back(); diff --git a/unittests/Support/CachePruningTest.cpp b/unittests/Support/CachePruningTest.cpp index 97d554eabc3..1bb57871925 100644 --- a/unittests/Support/CachePruningTest.cpp +++ b/unittests/Support/CachePruningTest.cpp @@ -59,7 +59,7 @@ TEST(CachePruningPolicyParser, MaxSizeBytes) { ASSERT_TRUE(bool(P)); EXPECT_EQ(75u, P->MaxSizePercentageOfAvailableSpace); EXPECT_EQ(3u * 1024u * 1024u, P->MaxSizeBytes); - P = parseCachePruningPolicy("cache_size_bytes=4g"); + P = parseCachePruningPolicy("cache_size_bytes=4G"); ASSERT_TRUE(bool(P)); EXPECT_EQ(75u, P->MaxSizePercentageOfAvailableSpace); EXPECT_EQ(4ull * 1024ull * 1024ull * 1024ull, P->MaxSizeBytes);