[PATCH] D53239: [python] [tests] Disable python binding tests when building with LLVM_USE_SANITIZER=Address

2018-10-15 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL344537: [python] [tests] Disable python binding tests under 
LLVM_USE_SANITIZER=Address (authored by dergachev, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D53239?vs=169535=169724#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D53239

Files:
  cfe/trunk/bindings/python/tests/CMakeLists.txt


Index: cfe/trunk/bindings/python/tests/CMakeLists.txt
===
--- cfe/trunk/bindings/python/tests/CMakeLists.txt
+++ cfe/trunk/bindings/python/tests/CMakeLists.txt
@@ -7,9 +7,24 @@
 DEPENDS libclang
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
+# Check if we are building with ASan
+list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
+if (LLVM_USE_ASAN_INDEX EQUAL -1)
+  set(LLVM_USE_ASAN FALSE)
+else()
+  set(LLVM_USE_ASAN TRUE)
+endif()
+
 # Tests fail on Windows, and need someone knowledgeable to fix.
 # It's not clear whether it's a test or a valid binding problem.
-if(NOT WIN32)
+#
+# Do not try to run if libclang was built with ASan because
+# the sanitizer library will likely be loaded too late to perform
+# interception and will then fail.
+# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
+# portable so its easier just to not run the tests when building
+# with ASan.
+if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
 set_property(GLOBAL APPEND PROPERTY
  LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
 endif()


Index: cfe/trunk/bindings/python/tests/CMakeLists.txt
===
--- cfe/trunk/bindings/python/tests/CMakeLists.txt
+++ cfe/trunk/bindings/python/tests/CMakeLists.txt
@@ -7,9 +7,24 @@
 DEPENDS libclang
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
+# Check if we are building with ASan
+list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
+if (LLVM_USE_ASAN_INDEX EQUAL -1)
+  set(LLVM_USE_ASAN FALSE)
+else()
+  set(LLVM_USE_ASAN TRUE)
+endif()
+
 # Tests fail on Windows, and need someone knowledgeable to fix.
 # It's not clear whether it's a test or a valid binding problem.
-if(NOT WIN32)
+#
+# Do not try to run if libclang was built with ASan because
+# the sanitizer library will likely be loaded too late to perform
+# interception and will then fail.
+# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
+# portable so its easier just to not run the tests when building
+# with ASan.
+if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
 set_property(GLOBAL APPEND PROPERTY
  LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
 endif()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53239: [python] [tests] Disable python binding tests when building with LLVM_USE_SANITIZER=Address

2018-10-13 Thread Michał Górny via Phabricator via cfe-commits
mgorny accepted this revision.
mgorny added a comment.

WFM. Thanks for analyzing the problem.




Comment at: bindings/python/tests/CMakeLists.txt:27
+# with ASan.
+if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
 set_property(GLOBAL APPEND PROPERTY

Hmm, I don't think you need to parenthesize the `(NOT FOO)` thing (and it looks 
bit weird to me).


Repository:
  rC Clang

https://reviews.llvm.org/D53239



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53239: [python] [tests] Disable python binding tests when building with LLVM_USE_SANITIZER=Address

2018-10-12 Thread Dan Liew via Phabricator via cfe-commits
delcypher accepted this revision.
delcypher added a comment.
This revision is now accepted and ready to land.

LGTM. But then I would say that because I wrote the patch ...


Repository:
  rC Clang

https://reviews.llvm.org/D53239



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D53239: [python] [tests] Disable python binding tests when building with LLVM_USE_SANITIZER=Address

2018-10-12 Thread Artem Dergachev via Phabricator via cfe-commits
NoQ created this revision.
NoQ added reviewers: mgorny, delcypher.
Herald added a subscriber: cfe-commits.

@mgorny: These fail for me on macOS too, if LLVM is configured as

  cmake ../llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_SANITIZER=Address

I guess we might have to outright disable them under 
`-DLLVM_USE_SANITIZER=Address`.

Patch actually by Dan "@delcypher" Liew, I'm just passing by.


Repository:
  rC Clang

https://reviews.llvm.org/D53239

Files:
  bindings/python/tests/CMakeLists.txt


Index: bindings/python/tests/CMakeLists.txt
===
--- bindings/python/tests/CMakeLists.txt
+++ bindings/python/tests/CMakeLists.txt
@@ -7,9 +7,24 @@
 DEPENDS libclang
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
+# Check if we are building with ASan
+list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
+if (LLVM_USE_ASAN_INDEX EQUAL -1)
+  set(LLVM_USE_ASAN FALSE)
+else()
+  set(LLVM_USE_ASAN TRUE)
+endif()
+
 # Tests fail on Windows, and need someone knowledgeable to fix.
 # It's not clear whether it's a test or a valid binding problem.
-if(NOT WIN32)
+#
+# Do not try to run if libclang was built with ASan because
+# the sanitizer library will likely be loaded too late to perform
+# interception and will then fail.
+# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
+# portable so its easier just to not run the tests when building
+# with ASan.
+if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
 set_property(GLOBAL APPEND PROPERTY
  LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
 endif()


Index: bindings/python/tests/CMakeLists.txt
===
--- bindings/python/tests/CMakeLists.txt
+++ bindings/python/tests/CMakeLists.txt
@@ -7,9 +7,24 @@
 DEPENDS libclang
 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)
 
+# Check if we are building with ASan
+list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
+if (LLVM_USE_ASAN_INDEX EQUAL -1)
+  set(LLVM_USE_ASAN FALSE)
+else()
+  set(LLVM_USE_ASAN TRUE)
+endif()
+
 # Tests fail on Windows, and need someone knowledgeable to fix.
 # It's not clear whether it's a test or a valid binding problem.
-if(NOT WIN32)
+#
+# Do not try to run if libclang was built with ASan because
+# the sanitizer library will likely be loaded too late to perform
+# interception and will then fail.
+# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
+# portable so its easier just to not run the tests when building
+# with ASan.
+if((NOT WIN32) AND (NOT LLVM_USE_ASAN))
 set_property(GLOBAL APPEND PROPERTY
  LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
 endif()
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits