From: Xing Xue Date: Tue, 14 May 2019 13:54:33 +0000 (+0000) Subject: [lit][tests]Add feature libcxx-used and use it in llvm-*-fuzzer tests X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d53e7ff1c46b531833464cac6610760e2fbd29a6;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360672 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/lit.cfg.py b/test/lit.cfg.py index f92f7912038..a67bd6527a5 100644 --- a/test/lit.cfg.py +++ b/test/lit.cfg.py @@ -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') diff --git a/test/lit.site.cfg.py.in b/test/lit.site.cfg.py.in index ada27ff6a77..ef3ae83369c 100644 --- a/test/lit.site.cfg.py.in +++ b/test/lit.site.cfg.py.in @@ -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. diff --git a/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll b/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll index 339d7b6b8e7..2cab8c74799 100644 --- a/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll +++ b/test/tools/llvm-isel-fuzzer/aarch64-execname-options.ll @@ -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 diff --git a/test/tools/llvm-isel-fuzzer/execname-options.ll b/test/tools/llvm-isel-fuzzer/execname-options.ll index a825cb450cc..dfce73ed2e2 100644 --- a/test/tools/llvm-isel-fuzzer/execname-options.ll +++ b/test/tools/llvm-isel-fuzzer/execname-options.ll @@ -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 diff --git a/test/tools/llvm-opt-fuzzer/exec-options.ll b/test/tools/llvm-opt-fuzzer/exec-options.ll index 56996535650..1dd0fa5c46b 100644 --- a/test/tools/llvm-opt-fuzzer/exec-options.ll +++ b/test/tools/llvm-opt-fuzzer/exec-options.ll @@ -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