summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp b/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp
index 9b44ac55917..446775bdce6 100644
--- a/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/ReadabilityModuleTest.cpp
@@ -457,6 +457,27 @@ TEST(BracesAroundStatementsCheck, Macros) {
"int main() {\n"
" FOR(;;)\n"
"}");
+ EXPECT_EQ("#define DO_IT ++i\n"
+ "int i = 0;\n"
+ "int main() {\n"
+ " if (false) {\n"
+ " DO_IT;\n"
+ " } else if (1 == 2) {\n"
+ " DO_IT;\n"
+ " } else {\n"
+ " DO_IT;\n"
+ "}\n"
+ "}",
+ runCheckOnCode<BracesAroundStatementsCheck>("#define DO_IT ++i\n"
+ "int i = 0;\n"
+ "int main() {\n"
+ " if (false)\n"
+ " DO_IT;\n"
+ " else if (1 == 2)\n"
+ " DO_IT;\n"
+ " else\n"
+ " DO_IT;\n"
+ "}"));
}
} // namespace test
OpenPOWER on IntegriCloud