summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-02 08:44:14 +0000
committerDaniel Jasper <djasper@google.com>2013-01-02 08:44:14 +0000
commitd1926a3758e9c031e4a9f48d9ccdd754e438a816 (patch)
tree4ec6f8999eabbb24af0951b4996477c7b0301193 /clang/unittests/Format/FormatTest.cpp
parent9791afb1821b9163a8db162ed2e9aeef13819a02 (diff)
downloadbcm5719-llvm-d1926a3758e9c031e4a9f48d9ccdd754e438a816.tar.gz
bcm5719-llvm-d1926a3758e9c031e4a9f48d9ccdd754e438a816.zip
Don't break after pointer or reference specifier.
This fixes llvm.org/PR14717. Buggy format: TypeSpecDecl * TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *II, Type *T) { Now changed to: TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *II, Type *T) { llvm-svn: 171357
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index b719acfabc6..99204f56f58 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -682,6 +682,16 @@ TEST_F(FormatTest, UnderstandsUsesOfStar) {
verifyGoogleFormat("A<int**, int**> a;");
}
+TEST_F(FormatTest, DoesNotBreakBeforePointerOrReference) {
+ verifyFormat(
+ "int *someFunction(int LoooooooooooooooongParam1,\n"
+ " int LoooooooooooooooongParam2) {\n}");
+ verifyFormat(
+ "TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC,\n"
+ " SourceLocation L, IdentifierIn *II,\n"
+ " Type *T) {\n}");
+}
+
TEST_F(FormatTest, LineStartsWithSpecialCharacter) {
verifyFormat("(a)->b();");
verifyFormat("--a;");
OpenPOWER on IntegriCloud