aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 9b9f5c71d2..e9520b618c 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1615,6 +1615,14 @@ TEST_F(FormatTest, UnderstandsUsesOfStarAndAmp) {
verifyIndependentOfContext("a * (a + b);");
verifyIndependentOfContext("(a *)(a + b);");
verifyIndependentOfContext("int *pa = (int *)&a;");
+ verifyIndependentOfContext("return sizeof(int **);");
+ verifyIndependentOfContext("return sizeof(int ******);");
+ verifyIndependentOfContext("return (int **&)a;");
+ verifyGoogleFormat("return sizeof(int**);");
+ verifyIndependentOfContext("Type **A = static_cast<Type **>(P);");
+ verifyGoogleFormat("Type** A = static_cast<Type**>(P);");
+ // FIXME: The newline is wrong.
+ verifyFormat("auto a = [](int **&, int ***) {}\n;");
verifyIndependentOfContext("InvalidRegions[*R] = 0;");
@@ -2540,8 +2548,7 @@ TEST_F(FormatTest, ObjCSnippets) {
verifyFormat("@dynamic textColor;");
verifyFormat("char *buf1 = @encode(int *);");
verifyFormat("char *buf1 = @encode(typeof(4 * 5));");
- // FIXME: Enable once PR14884 is fixed:
- //verifyFormat("char *buf1 = @encode(int **);");
+ verifyFormat("char *buf1 = @encode(int **);");
verifyFormat("Protocol *proto = @protocol(p1);");
verifyFormat("SEL s = @selector(foo:);");
verifyFormat("@synchronized(self) {\n"