[PATCH] D67319: Fix dlopen-mixed-c-cxx test case when libstdc++ is not available

serge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 7 08:57:02 PDT 2019


serge-sans-paille created this revision.
serge-sans-paille added a reviewer: Hahnfeld.
Herald added subscribers: llvm-commits, Sanitizers, srhines.
Herald added projects: Sanitizers, LLVM.

compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c test case requires libstdc++ to be linked and available. Make this requirement explicit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D67319

Files:
  compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
  compiler-rt/test/lit.common.cfg.py
  compiler-rt/test/lit.common.configured.in


Index: compiler-rt/test/lit.common.configured.in
===================================================================
--- compiler-rt/test/lit.common.configured.in
+++ 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.
Index: compiler-rt/test/lit.common.cfg.py
===================================================================
--- compiler-rt/test/lit.common.cfg.py
+++ 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)]
Index: compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
===================================================================
--- compiler-rt/test/asan/TestCases/Linux/dlopen-mixed-c-cxx.c
+++ 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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67319.219246.patch
Type: text/x-patch
Size: 1722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190907/e90c79e3/attachment.bin>


More information about the llvm-commits mailing list