This revision was automatically updated to reflect the committed changes.
Closed by commit rCRT351109: [test] Disable sunrpc tests when rpc/xdr.h is 
missing (authored by mgorny, committed by ).

Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D47819/new/

https://reviews.llvm.org/D47819

Files:
  cmake/Modules/CompilerRTUtils.cmake
  cmake/base-config-ix.cmake
  lib/sanitizer_common/CMakeLists.txt
  test/lit.common.cfg
  test/lit.common.configured.in
  test/msan/Linux/sunrpc.cc
  test/msan/Linux/sunrpc_bytes.cc
  test/msan/Linux/sunrpc_string.cc
  test/tsan/sunrpc.cc

Index: cmake/base-config-ix.cmake
===================================================================
--- cmake/base-config-ix.cmake
+++ cmake/base-config-ix.cmake
@@ -8,6 +8,12 @@
 
 check_include_file(unwind.h HAVE_UNWIND_H)
 
+# Used by sanitizer_common and tests.
+check_include_file(rpc/xdr.h HAVE_RPC_XDR_H)
+if (NOT HAVE_RPC_XDR_H)
+  set(HAVE_RPC_XDR_H 0)
+endif()
+
 # Top level target used to build all compiler-rt libraries.
 add_custom_target(compiler-rt ALL)
 add_custom_target(install-compiler-rt)
Index: cmake/Modules/CompilerRTUtils.cmake
===================================================================
--- cmake/Modules/CompilerRTUtils.cmake
+++ cmake/Modules/CompilerRTUtils.cmake
@@ -58,14 +58,6 @@
   endif()
 endmacro()
 
-macro(append_have_file_definition filename varname list)
-  check_include_file("${filename}" "${varname}")
-  if (NOT ${varname})
-    set("${varname}" 0)
-  endif()
-  list(APPEND ${list} "${varname}=${${varname}}")
-endmacro()
-
 macro(list_intersect output input1 input2)
   set(${output})
   foreach(it ${${input1}})
Index: test/lit.common.configured.in
===================================================================
--- test/lit.common.configured.in
+++ test/lit.common.configured.in
@@ -36,6 +36,7 @@
 set_default("use_lto", config.use_thinlto)
 set_default("use_newpm", False)
 set_default("android", @ANDROID_PYBOOL@)
+set_default("have_rpc_xdr_h", @HAVE_RPC_XDR_H@)
 config.available_features.add('target-is-%s' % config.target_arch)
 
 if config.enable_per_target_runtime_dir:
Index: test/tsan/sunrpc.cc
===================================================================
--- test/tsan/sunrpc.cc
+++ test/tsan/sunrpc.cc
@@ -1,3 +1,5 @@
+// REQUIRES: sunrpc
+
 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
 
 #include <pthread.h>
Index: test/msan/Linux/sunrpc_bytes.cc
===================================================================
--- test/msan/Linux/sunrpc_bytes.cc
+++ test/msan/Linux/sunrpc_bytes.cc
@@ -1,3 +1,5 @@
+// REQUIRES: sunrpc
+
 // RUN: %clangxx_msan -g -O0 %s -o %t && \
 // RUN:     %run %t 2>&1
 // RUN: %clangxx_msan -g -O0 -DUNINIT=1 %s -o %t && \
Index: test/msan/Linux/sunrpc.cc
===================================================================
--- test/msan/Linux/sunrpc.cc
+++ test/msan/Linux/sunrpc.cc
@@ -1,3 +1,5 @@
+// REQUIRES: sunrpc
+
 // RUN: %clangxx_msan -g -O0 -DTYPE=int -DFN=xdr_int %s -o %t && \
 // RUN:     %run %t 2>&1
 // RUN: %clangxx_msan -g -O0 -DTYPE=int -DFN=xdr_int -DUNINIT=1 %s -o %t && \
Index: test/msan/Linux/sunrpc_string.cc
===================================================================
--- test/msan/Linux/sunrpc_string.cc
+++ test/msan/Linux/sunrpc_string.cc
@@ -1,3 +1,5 @@
+// REQUIRES: sunrpc
+
 // RUN: %clangxx_msan -g -O0 %s -o %t && \
 // RUN:     %run %t 2>&1
 // RUN: %clangxx_msan -g -O0 -DUNINIT=1 %s -o %t && \
Index: test/lit.common.cfg
===================================================================
--- test/lit.common.cfg
+++ test/lit.common.cfg
@@ -359,6 +359,9 @@
   if config.use_newpm:
     config.lto_flags += ["-fexperimental-new-pass-manager"]
 
+if config.have_rpc_xdr_h:
+  config.available_features.add('sunrpc')
+
 # Ask llvm-config about assertion mode.
 try:
   llvm_config_cmd = subprocess.Popen(
Index: lib/sanitizer_common/CMakeLists.txt
===================================================================
--- lib/sanitizer_common/CMakeLists.txt
+++ lib/sanitizer_common/CMakeLists.txt
@@ -192,10 +192,8 @@
 
 include_directories(..)
 
-set(SANITIZER_COMMON_DEFINITIONS)
-
-include(CheckIncludeFile)
-append_have_file_definition(rpc/xdr.h HAVE_RPC_XDR_H SANITIZER_COMMON_DEFINITIONS)
+set(SANITIZER_COMMON_DEFINITIONS
+  HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H})
 
 set(SANITIZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 append_rtti_flag(OFF SANITIZER_CFLAGS)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to