[clang] [analyzer] Fix tests broken by empty %z3_include_dir (PR #146042)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 27 03:18:08 PDT 2025


=?utf-8?q?DonĂ¡t?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/146042 at github.com>


================
@@ -173,13 +173,16 @@ def have_host_clang_repl_cuda():
     config.available_features.add("staticanalyzer")
     tools.append("clang-check")
 
+    I_z3_include_dir = ""
     if config.clang_staticanalyzer_z3:
         config.available_features.add("z3")
-        config.substitutions.append(
-            ("%z3_include_dir", config.clang_staticanalyzer_z3_include_dir)
-        )
+        if config.clang_staticanalyzer_z3_include_dir:
----------------
steakhal wrote:

Shouldn't the presence of `config.clang_staticanalyzer_z3` imply the presence of `config.clang_staticanalyzer_z3_include_dir`?

The problem I see here is that the `clang/test/Analysis/z3-crosscheck-max-attempts.cpp` test case would not compile without the necessary Z3 include dir. So `config.clang_staticanalyzer_z3` should imply `config.clang_staticanalyzer_z3_include_dir`. Otherwise the `REQUIRES: z3` filter would not cover the test case and still fail. In conclusion, substituting `I_z3_include_dir` to an empty string is not the right solution. It can't be.

https://github.com/llvm/llvm-project/pull/146042


More information about the cfe-commits mailing list