diff --git a/clang/unittests/Format/FormatTestBase.h b/clang/unittests/Format/FormatTestBase.h index 2b0c4550bb951..22eea23b869a2 100644 --- a/clang/unittests/Format/FormatTestBase.h +++ b/clang/unittests/Format/FormatTestBase.h @@ -105,7 +105,9 @@ class FormatTestBase : public ::testing::Test { void _verifyFormat(const char *File, int Line, llvm::StringRef Code, const std::optional &Style = {}) { - _verifyFormat(File, Line, Code, test::messUp(Code), Style); + _verifyFormat(File, Line, Code, Code, Style); + if (const auto MessedUpCode{messUp(Code)}; MessedUpCode != Code) + _verifyFormat(File, Line, Code, MessedUpCode, Style); } void _verifyIncompleteFormat(const char *File, int Line, llvm::StringRef Code,