summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-10-06 13:16:43 +0000
committerDaniel Jasper <djasper@google.com>2014-10-06 13:16:43 +0000
commita45eb4c000e2bd9bba49e31fed25c308a4961dd4 (patch)
tree06744fdc13d105cb8bd7a739cad3bbafd077a52b /clang/unittests/Format/FormatTest.cpp
parenta117002d93b1f0e9488a68d5d3b540ca795bc9e5 (diff)
downloadbcm5719-llvm-a45eb4c000e2bd9bba49e31fed25c308a4961dd4.tar.gz
bcm5719-llvm-a45eb4c000e2bd9bba49e31fed25c308a4961dd4.zip
clang-format: If in doubt, assume '+' is a binary operator.
Before: #define LENGTH(x, y) (x) - (y)+1 After: #define LENGTH(x, y) (x) - (y) + 1 llvm-svn: 219119
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index f44fec6fe98..0842711749d 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5116,6 +5116,7 @@ TEST_F(FormatTest, FormatsCasts) {
verifyFormat("my_int a = (my_int)sizeof(int);");
verifyFormat("return (my_int)aaa;");
verifyFormat("#define x ((int)-1)");
+ verifyFormat("#define LENGTH(x, y) (x) - (y) + 1");
verifyFormat("#define p(q) ((int *)&q)");
verifyFormat("fn(a)(b) + 1;");
@@ -5123,7 +5124,7 @@ TEST_F(FormatTest, FormatsCasts) {
verifyFormat("void f() { return P ? (my_int)*P : (my_int)0; }");
verifyFormat("my_int a = (my_int)~0;");
verifyFormat("my_int a = (my_int)++a;");
- verifyFormat("my_int a = (my_int)+2;");
+ verifyFormat("my_int a = (my_int)-2;");
verifyFormat("my_int a = (my_int)1;");
verifyFormat("my_int a = (my_int *)1;");
verifyFormat("my_int a = (const my_int)-1;");
OpenPOWER on IntegriCloud