]> granicus.if.org Git - clang/commitdiff
[Analysis] Only run plugins tests if plugins are actually enabled
authorPetr Hosek <phosek@chromium.org>
Fri, 17 May 2019 06:07:37 +0000 (06:07 +0000)
committerPetr Hosek <phosek@chromium.org>
Fri, 17 May 2019 06:07:37 +0000 (06:07 +0000)
When plugins aren't enabled, don't try to run plugins tests. Don't
enable plugins unconditionally based on the platform, instead check
if LLVM shared library is actually being built which may not be the
case for every host configuration, even if the host itself supports
plugins.

This addresses test failures introduced by r360891/D59464.

Differential Revision: https://reviews.llvm.org/D62050

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

test/Analysis/checker-plugins.c
test/CMakeLists.txt
test/lit.cfg.py
test/lit.site.cfg.py.in

index ce618f5cdd521158054b82acf452e8a0a09847a8..4ed4e8630e277026a130fc56a99f923ee873dcc7 100644 (file)
@@ -1,9 +1,9 @@
+// REQUIRES: plugins
+
 // RUN: %clang_analyze_cc1 -verify %s \
 // RUN:   -load %llvmshlibdir/SampleAnalyzerPlugin%pluginext \
 // RUN:   -analyzer-checker='example.MainCallChecker'
 
-// REQUIRES: plugins
-
 // Test that the MainCallChecker example analyzer plugin loads and runs.
 
 int main();
index 9f6bcbb5ab5386a9a2041f795639d2ff4b851ada..339f637847debd16d3ddd0adda947c199e14767e 100644 (file)
@@ -24,7 +24,8 @@ llvm_canonicalize_cmake_booleans(
   CLANG_ENABLE_STATIC_ANALYZER
   ENABLE_BACKTRACES
   HAVE_LIBZ
-  LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
+  LLVM_ENABLE_PER_TARGET_RUNTIME_DIR
+  LLVM_ENABLE_PLUGINS)
 
 configure_lit_site_cfg(
   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
index ec08cc1eeae64f6a570be9ceba6fbaecb169e458..c66ed9c08aba98c5354293872ffd6d1646272d8c 100644 (file)
@@ -85,13 +85,7 @@ config.substitutions.append(
                              os.path.join(config.clang_tools_dir, 'hmaptool'))))
 
 # Plugins (loadable modules)
-# TODO: This should be supplied by Makefile or autoconf.
-if sys.platform in ['win32', 'cygwin']:
-    has_plugins = config.enable_shared
-else:
-    has_plugins = True
-
-if has_plugins and config.llvm_plugin_ext:
+if config.has_plugins and config.llvm_plugin_ext:
     config.available_features.add('plugins')
 
 # Set available features we allow tests to conditionalize on.
index 953fd8dd33aa0bcef80de99982ec3a2b62c32d8e..06633b227c1ec99a18923f37224fd6eb2c60b3de 100644 (file)
@@ -27,6 +27,7 @@ config.enable_backtrace = @ENABLE_BACKTRACES@
 config.host_arch = "@HOST_ARCH@"
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
+config.has_plugins = @LLVM_ENABLE_PLUGINS@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.