summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-05-17 06:07:37 +0000
committerPetr Hosek <phosek@chromium.org>2019-05-17 06:07:37 +0000
commitb7804ef3a746cd6c2c95c81eb19a81fb9df34cc6 (patch)
tree5af4803cd2b9646b01acb025071b13171314d130 /clang
parentad7199f3e60a49db023099dcb879fcc9cdf94a2e (diff)
downloadbcm5719-llvm-b7804ef3a746cd6c2c95c81eb19a81fb9df34cc6.tar.gz
bcm5719-llvm-b7804ef3a746cd6c2c95c81eb19a81fb9df34cc6.zip
[Analysis] Only run plugins tests if plugins are actually enabled
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 llvm-svn: 360991
Diffstat (limited to 'clang')
-rw-r--r--clang/test/Analysis/checker-plugins.c4
-rw-r--r--clang/test/CMakeLists.txt3
-rw-r--r--clang/test/lit.cfg.py8
-rw-r--r--clang/test/lit.site.cfg.py.in1
4 files changed, 6 insertions, 10 deletions
diff --git a/clang/test/Analysis/checker-plugins.c b/clang/test/Analysis/checker-plugins.c
index ce618f5cdd5..4ed4e8630e2 100644
--- a/clang/test/Analysis/checker-plugins.c
+++ b/clang/test/Analysis/checker-plugins.c
@@ -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();
diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 9f6bcbb5ab5..339f637847d 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -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
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index ec08cc1eeae..c66ed9c08ab 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -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.
diff --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 953fd8dd33a..06633b227c1 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -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.
OpenPOWER on IntegriCloud