summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 28d9fbe4e22..7b57e858a44 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -1235,6 +1235,14 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
" *A, // Operator detection might be confused by the '{'\n"
" *BB // Operator detection might be confused by previous comment\n"
"};");
+
+ verifyFormat("if (int *a = &b)");
+ verifyFormat("if (int &a = *b)");
+ verifyFormat("if (a & b[i])");
+ verifyFormat("if (a::b::c::d & b[i])");
+ verifyFormat("if (*b[i])");
+ verifyFormat("if (int *a = (&b))");
+ verifyFormat("while (int *a = &b)");
}
TEST_F(FormatTest, FormatsCasts) {
OpenPOWER on IntegriCloud