From 9bc0ae5b33d0201c66b97eca1c8b3ab3e2e1aa12 Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Mon, 6 Mar 2023 21:34:11 +0100
Subject: [PATCH] Make these test files not to be optimized compiling with
 clang.

I observed a very long compilation time using clang-10 with these two files.
---
 tests/test_ASTNodeAffectationExpressionBuilder.cpp | 4 ++++
 tests/test_DiscreteFunctionP0.cpp                  | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/tests/test_ASTNodeAffectationExpressionBuilder.cpp b/tests/test_ASTNodeAffectationExpressionBuilder.cpp
index 64c152219..c20490e5a 100644
--- a/tests/test_ASTNodeAffectationExpressionBuilder.cpp
+++ b/tests/test_ASTNodeAffectationExpressionBuilder.cpp
@@ -171,6 +171,8 @@ const auto builtin_data_type = ast_node_data_type_from<std::shared_ptr<const dou
     OperatorRepository::instance().reset();                                                                     \
   }
 
+#pragma clang optimize off
+
 // clazy:excludeall=non-pod-global-static
 
 TEST_CASE("ASTNodeAffectationExpressionBuilder", "[language]")
@@ -7483,3 +7485,5 @@ let v :(R^3x3), v = bt;
     }
   }
 }
+
+#pragma clang optimize on
diff --git a/tests/test_DiscreteFunctionP0.cpp b/tests/test_DiscreteFunctionP0.cpp
index 48c107e4a..3253cd6fe 100644
--- a/tests/test_DiscreteFunctionP0.cpp
+++ b/tests/test_DiscreteFunctionP0.cpp
@@ -4,6 +4,8 @@
 #include <MeshDataBaseForTests.hpp>
 #include <scheme/DiscreteFunctionP0.hpp>
 
+#pragma clang optimize off
+
 // clazy:excludeall=non-pod-global-static
 
 TEST_CASE("DiscreteFunctionP0", "[scheme]")
@@ -3697,3 +3699,5 @@ TEST_CASE("DiscreteFunctionP0", "[scheme]")
   }
 #endif   // NDEBUG
 }
+
+#pragma clang optimize on
-- 
GitLab