aboutsummaryrefslogtreecommitdiffstats
path: root/main/clang/llvm-hello.patch
blob: b5cd37a3ed0bb405ff9dd8a3dc050940fa76a463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Taken from https://reviews.llvm.org/D120301

diff --git a/tools/extra/test/CMakeLists.txt b/tools/extra/test/CMakeLists.txt
--- a/tools/extra/test/CMakeLists.txt
+++ b/tools/extra/test/CMakeLists.txt
@@ -15,10 +15,15 @@
 
 string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
 
+if (TARGET LLVMHello)
+  set (LLVM_HAS_LLVM_HELLO 1)
+endif()
+
 llvm_canonicalize_cmake_booleans(
   CLANG_TIDY_ENABLE_STATIC_ANALYZER
   CLANG_PLUGIN_SUPPORT
   LLVM_INSTALL_TOOLCHAIN_ONLY
+  LLVM_HAS_LLVM_HELLO
   )
 
 configure_lit_site_cfg(
@@ -97,7 +102,10 @@
   endif()
 
   if(TARGET CTTestTidyModule)
-      list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule LLVMHello)
+      list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
+      if (TARGET  LLVMHello)
+        list(APPEND CLANG_TOOLS_TEST_DEPS CTTestTidyModule)
+      endif()
       target_include_directories(CTTestTidyModule PUBLIC BEFORE "${CLANG_TOOLS_SOURCE_DIR}")
       if(CLANG_PLUGIN_SUPPORT AND (WIN32 OR CYGWIN))
         set(LLVM_LINK_COMPONENTS
diff --git a/tools/extra/test/clang-tidy/CTTestTidyModule.cpp b/tools/extra/test/clang-tidy/CTTestTidyModule.cpp
--- a/tools/extra/test/clang-tidy/CTTestTidyModule.cpp
+++ b/tools/extra/test/clang-tidy/CTTestTidyModule.cpp
@@ -1,4 +1,4 @@
-// REQUIRES: plugins
+// REQUIRES: plugins, llvm-hello
 // RUN: clang-tidy -checks='-*,mytest*' --list-checks -load %llvmshlibdir/CTTestTidyModule%pluginext -load %llvmshlibdir/LLVMHello%pluginext | FileCheck --check-prefix=CHECK-LIST %s
 // CHECK-LIST: Enabled checks:
 // CHECK-LIST-NEXT:    mytest1
diff --git a/tools/extra/test/lit.cfg.py b/tools/extra/test/lit.cfg.py
--- a/tools/extra/test/lit.cfg.py
+++ b/tools/extra/test/lit.cfg.py
@@ -155,3 +155,6 @@
 # Plugins (loadable modules)
 if config.has_plugins and config.llvm_plugin_ext:
     config.available_features.add('plugins')
+
+if config.has_llvm_hello:
+    config.available_features.add("llvm-hello")
diff --git a/tools/extra/test/lit.site.cfg.py.in b/tools/extra/test/lit.site.cfg.py.in
--- a/tools/extra/test/lit.site.cfg.py.in
+++ b/tools/extra/test/lit.site.cfg.py.in
@@ -13,6 +13,7 @@
 config.target_triple = "@TARGET_TRIPLE@"
 config.clang_tidy_staticanalyzer = @CLANG_TIDY_ENABLE_STATIC_ANALYZER@
 config.has_plugins = @CLANG_PLUGIN_SUPPORT@ & ~@LLVM_INSTALL_TOOLCHAIN_ONLY@
+config.has_llvm_hello = @LLVM_HAS_LLVM_HELLO@
 
 # 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.