aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-01-23 09:32:48 +0000
committerManuel Klimek <klimek@google.com>2013-01-23 09:32:48 +0000
commit70b03f4edaefcc5b9aa2e084d1c12e9d91b32a77 (patch)
treee43b61232306a4d0ea1fee82dc51eab210a1710e /unittests/Format/FormatTest.cpp
parent69652660e765ec2bbcf1877ac05c66e91b8fa745 (diff)
Allow us to better guess the context of an unwrapped line.
This gives us the ability to guess better defaults for whether a * between identifiers is a pointer dereference or binary operator. Now correctly formats: void f(a *b); void f() { f(a * b); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173243 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 3065a836dd..7daf7aac6c 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1666,6 +1666,11 @@ TEST_F(FormatTest, BlockComments) {
"/* */someCall(parameter);", getLLVMStyleWithColumns(15)));
}
+TEST_F(FormatTest, Fuck) {
+ verifyFormat("void f(int *a);");
+ verifyFormat("void f() { f(fint * b); }");
+}
+
//===----------------------------------------------------------------------===//
// Objective-C tests.
//===----------------------------------------------------------------------===//