clang-format: Fix crasher when splitting incomplete escape sequences.
llvm-svn: 226698
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 553368d..7c86d14 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -7444,6 +7444,12 @@
EXPECT_EQ("@\"NSString \"\n"
"@\"literal\";",
format("@\"NSString literal\";", getGoogleStyleWithColumns(19)));
+
+ // This input makes clang-format try to split the incomplete unicode escape
+ // sequence, which used to lead to a crasher.
+ verifyNoCrash(
+ "aaaaaaaaaaaaaaaaaaaa = L\"\\udff\"'; // aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+ getLLVMStyleWithColumns(60));
}
TEST_F(FormatTest, DoesNotBreakRawStringLiterals) {