summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/YAMLIOTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/YAMLIOTest.cpp')
-rw-r--r--llvm/unittests/Support/YAMLIOTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp
index bf70e749b4f..c3e18d33235 100644
--- a/llvm/unittests/Support/YAMLIOTest.cpp
+++ b/llvm/unittests/Support/YAMLIOTest.cpp
@@ -2368,3 +2368,11 @@ TEST(YAMLIO, TestMapWithContext) {
out);
out.clear();
}
+
+TEST(YAMLIO, InvalidInput) {
+ // polluting 1 value in the sequence
+ Input yin("---\n- foo: 3\n bar: 5\n1\n- foo: 3\n bar: 5\n...\n");
+ std::vector<FooBar> Data;
+ yin >> Data;
+ EXPECT_TRUE((bool)yin.error());
+}
OpenPOWER on IntegriCloud