diff --git a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c --- a/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c +++ b/compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c @@ -1,11 +1,11 @@ -// RUN: %clangxx_asan -xc++ -shared -fPIC -o %t.so - < %s +// RUN: %clangxx_asan -xc++ -stdlib=libstdc++ -shared -fPIC -o %t.so - < %s // RUN: %clang_asan %s -o %t.out -ldl // // RUN: { env ASAN_OPTIONS=verbosity=1 %t.out %t.so || : ; } 2>&1 | FileCheck %s // // CHECK: {{.*}}AddressSanitizer: failed to intercept '__cxa_{{.*}}throw{{.*}}' // -// REQUIRES: x86_64-target-arch && !android +// REQUIRES: x86_64-target-arch && !android && libstdcxx #ifdef __cplusplus diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py --- a/compiler-rt/test/lit.common.cfg.py +++ b/compiler-rt/test/lit.common.cfg.py @@ -477,6 +477,9 @@ else: config.available_features.add("shadow-scale-3") +if config.has_libstdcxx: + config.available_features.add("libstdcxx") + # Propagate the LLD/LTO into the clang config option, so nothing else is needed. run_wrapper = [] target_cflags = [getattr(config, 'target_cflags', None)] diff --git a/compiler-rt/test/lit.common.configured.in b/compiler-rt/test/lit.common.configured.in --- a/compiler-rt/test/lit.common.configured.in +++ b/compiler-rt/test/lit.common.configured.in @@ -51,6 +51,7 @@ set_default("have_zlib", "@HAVE_LIBZ@") set_default("libcxx_used", "@LLVM_LIBCXX_USED@") +set_default("has_libstdcxx", "@COMPILER_RT_HAS_LIBSTDCXX@") # LLVM tools dir can be passed in lit parameters, so try to # apply substitution.