[lit][tests]Add feature libcxx-used and use it in llvm-*-fuzzer tests
authorXing Xue <xingxue@outlook.com>
Tue, 14 May 2019 13:54:33 +0000 (13:54 +0000)
committerXing Xue <xingxue@outlook.com>
Tue, 14 May 2019 13:54:33 +0000 (13:54 +0000)
When a LLVM binary such as llvm-*-fuzzer is built with libc++, it has dependency on libc++. The path to find shared libraries specified in llvm-*-fuzzer is relative. As a result, these binaries cannot be copied to an arbitrary directory and launched from there. Changes in this patch add a LIT feature to indicate that libc++ is used to build and, based on the feature exclude test cases that test by copying llvm-*-fuzzer binaries to a directory.

Reviewers: hubert.reinterpretcast, dberris, amyk, jasonliu, EricWF

Reviewed By: hubert.reinterpretcast, amyk

Subscribers: javed.absar, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 360672

llvm/test/lit.cfg.py
llvm/test/lit.site.cfg.py.in
llvm/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
llvm/test/tools/llvm-isel-fuzzer/execname-options.ll
llvm/test/tools/llvm-opt-fuzzer/exec-options.ll

index f92f7912038bdd834aa4ee984107e19676155940..a67bd6527a501d75ac5629af0be2f559835bf6db 100644 (file)
@@ -228,6 +228,9 @@ def have_cxx_shared_library():
 if have_cxx_shared_library():
     config.available_features.add('cxx-shared-library')
 
+if config.libcxx_used:
+    config.available_features.add('libcxx-used')
+
 # Direct object generation
 if not 'hexagon' in config.target_triple:
     config.available_features.add('object-emission')
index ada27ff6a77450eb0b29c999adba57789a5fa6a7..ef3ae83369ce66445a8b237b92a95dfedf07da2c 100644 (file)
@@ -44,6 +44,7 @@ config.llvm_libxml2_enabled = @LLVM_LIBXML2_ENABLED@
 config.llvm_host_triple = '@LLVM_HOST_TRIPLE@'
 config.host_arch = "@HOST_ARCH@"
 config.have_opt_viewer_modules = @LLVM_HAVE_OPT_VIEWER_MODULES@
+config.libcxx_used = @LLVM_LIBCXX_USED@
 
 # Support substitution of the tools_dir with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
index 339d7b6b8e79436935bf3132084dea144e70b780..2cab8c747999dbf2433cb53c13bad16485e6de83 100644 (file)
@@ -3,6 +3,9 @@
 ; REQUIRES: static-libs
 ; REQUIRES: aarch64-registered-target
 
+; The above also applies if the binary is built with libc++.
+; UNSUPPORTED: libcxx-used
+
 ; RUN: echo > %t.input
 
 ; RUN: cp llvm-isel-fuzzer %t.bin--aarch64
index a825cb450cc514a142b4557555f1264bb0250eff..dfce73ed2e24cd6d86dfd08b07da8808bd25e00f 100644 (file)
@@ -2,6 +2,9 @@
 ; without copying the whole lib dir or polluting the build dir.
 ; REQUIRES: static-libs
 
+; The above also applies if the binary is built with libc++.
+; UNSUPPORTED: libcxx-used
+
 ; RUN: echo > %t.input
 
 ; RUN: cp llvm-isel-fuzzer %t.bin--gisel
index 569965356500732827d3f1f133e0e435056bdb45..1dd0fa5c46b731c51b00fff29f169913fa5cc9d2 100644 (file)
@@ -3,6 +3,9 @@
 ; REQUIRES: static-libs
 ; REQUIRES: x86-registered-target
 
+; The above also applies if the binary is built with libc++.
+; UNSUPPORTED: libcxx-used
+
 ; This test is really flaky on Windows. On Windows, executables and DLLs cannot
 ; be deleted or written while they are loaded. The OS unlocks the file some
 ; time after the process terminates, so if 'rm' runs too quickly, it will fail