summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-31 15:58:48 +0000
committerManuel Klimek <klimek@google.com>2013-01-31 15:58:48 +0000
commit591b58025591decba7602813679145bd380a0851 (patch)
tree8298cd53167cb2dfe8b1def11db844df10625677 /clang/unittests/Format/FormatTest.cpp
parent8a8ce2406a2283b428bd62a4820a2657e8aa902f (diff)
downloadbcm5719-llvm-591b58025591decba7602813679145bd380a0851.tar.gz
bcm5719-llvm-591b58025591decba7602813679145bd380a0851.zip
Never break inside something that was a preprocessor directive.
Just put it in one unwrapped line and let the formatter handle it. llvm-svn: 174063
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 5ffd3518891..bffbbf53316 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -714,8 +714,10 @@ TEST_F(FormatTest, DoesNotBreakPureVirtualFunctionDefinition) {
" OwningPtr<FileOutputBuffer> &buffer) = 0;");
}
-TEST_F(FormatTest, BreaksOnHashWhenDirectiveIsInvalid) {
- EXPECT_EQ("#\n;", format("#;"));
+TEST_F(FormatTest, LayoutUnknownPPDirective) {
+ EXPECT_EQ("#123 \"A string literal\"",
+ format(" # 123 \"A string literal\""));
+ EXPECT_EQ("#;", format("#;"));
verifyFormat("#\n;\n;\n;");
}
OpenPOWER on IntegriCloud