diff options
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 28d9fbe4e2..7b57e858a4 100644 --- a/unittests/Format/FormatTest.cpp +++ b/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) { |