[llvm] r360672 - [lit][tests]Add feature libcxx-used and use it in llvm-*-fuzzer tests

Xing Xue via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 06:54:34 PDT 2019


Author: xingxue
Date: Tue May 14 06:54:33 2019
New Revision: 360672

URL: http://llvm.org/viewvc/llvm-project?rev=360672&view=rev
Log:
[lit][tests]Add feature libcxx-used and use it in llvm-*-fuzzer tests

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

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

Modified: llvm/trunk/test/lit.cfg.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.cfg.py?rev=360672&r1=360671&r2=360672&view=diff
==============================================================================
--- llvm/trunk/test/lit.cfg.py (original)
+++ llvm/trunk/test/lit.cfg.py Tue May 14 06:54:33 2019
@@ -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')

Modified: llvm/trunk/test/lit.site.cfg.py.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/lit.site.cfg.py.in?rev=360672&r1=360671&r2=360672&view=diff
==============================================================================
--- llvm/trunk/test/lit.site.cfg.py.in (original)
+++ llvm/trunk/test/lit.site.cfg.py.in Tue May 14 06:54:33 2019
@@ -44,6 +44,7 @@ config.llvm_libxml2_enabled = @LLVM_LIBX
 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.

Modified: llvm/trunk/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll?rev=360672&r1=360671&r2=360672&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll (original)
+++ llvm/trunk/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll Tue May 14 06:54:33 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-isel-fuzzer/execname-options.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-isel-fuzzer/execname-options.ll?rev=360672&r1=360671&r2=360672&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-isel-fuzzer/execname-options.ll (original)
+++ llvm/trunk/test/tools/llvm-isel-fuzzer/execname-options.ll Tue May 14 06:54:33 2019
@@ -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

Modified: llvm/trunk/test/tools/llvm-opt-fuzzer/exec-options.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-opt-fuzzer/exec-options.ll?rev=360672&r1=360671&r2=360672&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-opt-fuzzer/exec-options.ll (original)
+++ llvm/trunk/test/tools/llvm-opt-fuzzer/exec-options.ll Tue May 14 06:54:33 2019
@@ -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




More information about the llvm-commits mailing list