aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ADT/StringMapTest.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-09-01 18:40:05 -0400
committerNico Weber <thakis@chromium.org>2021-09-02 10:37:32 -0400
commit973519826edb7690270261a5b3512f32ae64063c (patch)
tree06bade6a747bc9cf9d30f9b4247aa41112abdf12 /llvm/unittests/ADT/StringMapTest.cpp
parent711aa35759e76f424fe617542dcb8653bf781f53 (diff)
downloadllvm-973519826edb7690270261a5b3512f32ae64063c.zip
llvm-973519826edb7690270261a5b3512f32ae64063c.tar.gz
llvm-973519826edb7690270261a5b3512f32ae64063c.tar.bz2
[clang-cl] Emit nicer warning on unknown /arch: arguments
Now prints the list of known archs. This requires plumbing a Driver arg through a few functions. Also add two more convenience insert() overlods to StringMap. Differential Revision: https://reviews.llvm.org/D109105
Diffstat (limited to 'llvm/unittests/ADT/StringMapTest.cpp')
-rw-r--r--llvm/unittests/ADT/StringMapTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp
index 98fbd6e..6a3cca5 100644
--- a/llvm/unittests/ADT/StringMapTest.cpp
+++ b/llvm/unittests/ADT/StringMapTest.cpp
@@ -111,6 +111,13 @@ TEST_F(StringMapTest, ConstEmptyMapTest) {
EXPECT_TRUE(constTestMap.find(testKeyStr) == constTestMap.end());
}
+// initializer_list ctor test; also implicitly tests initializer_list and
+// iterator overloads of insert().
+TEST_F(StringMapTest, InitializerListCtor) {
+ testMap = StringMap<uint32_t>({{"key", 1}});
+ assertSingleItemMap();
+}
+
// A map with a single entry.
TEST_F(StringMapTest, SingleEntryMapTest) {
testMap[testKey] = testValue;