]> granicus.if.org Git - clang/commitdiff
Disable clang-format's MemoizationTest as it becomes prohibitive with EXPENSIVE_CHECKS
authorDavid Blaikie <dblaikie@gmail.com>
Thu, 31 Aug 2017 18:49:34 +0000 (18:49 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Thu, 31 Aug 2017 18:49:34 +0000 (18:49 +0000)
EXPENSIVE_CHECKS enables libstdc++'s library consistency checks, which
includes checking the container passed to std::priority_queue for its
well-formedness. This makes the clang-format memoization too expensive,
so disable it.

(it's a necessary feature of libstdc++'s consistency checks that it
ruins the required scalability of C++ standard library features - so
these workarounds are to be expected if a test ever tries to test
scalability in some way, like this test does)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312268 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index 6db78cc2eb844b8137a70ae07010c2fc4d34c8fb..bdce0304f97cec4b9f032e7bcc31921e17f3a9f2 100644 (file)
@@ -3440,6 +3440,10 @@ TEST_F(FormatTest, BreakConstructorInitializersAfterColon) {
                Style);
 }
 
+#ifndef EXPENSIVE_CHECKS
+// Expensive checks enables libstdc++ checking which includes validating the
+// state of ranges used in std::priority_queue - this blows out the
+// runtime/scalability of the function and makes this test unacceptably slow.
 TEST_F(FormatTest, MemoizationTests) {
   // This breaks if the memoization lookup does not take \c Indent and
   // \c LastSpace into account.
@@ -3518,6 +3522,7 @@ TEST_F(FormatTest, MemoizationTests) {
   input += "           a) {}";
   verifyFormat(input, OnePerLine);
 }
+#endif
 
 TEST_F(FormatTest, BreaksAsHighAsPossible) {
   verifyFormat(