summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorMichal Gorny <mgorny@gentoo.org>2019-01-09 13:27:29 +0000
committerMichal Gorny <mgorny@gentoo.org>2019-01-09 13:27:29 +0000
commit2c2d65efab5669bb0313c29363724ca6415a0bb4 (patch)
tree1ea8b0b9af28cc436ad68f5d118e9c67f4d93f56 /compiler-rt
parent5a7132ff0f1720153e719329516be241dfb93cf8 (diff)
downloadbcm5719-llvm-2c2d65efab5669bb0313c29363724ca6415a0bb4.tar.gz
bcm5719-llvm-2c2d65efab5669bb0313c29363724ca6415a0bb4.zip
[test] Detect glibc-2.27+ and XFAIL appropriate tests
XFAIL the tests known to fail with glibc-2.27+. This takes away the burden of handling known failures from users, and ensures that we will be verbosely informed when they actually start working again. Bug report: https://bugs.llvm.org/show_bug.cgi?id=37804 Differential Revision: https://reviews.llvm.org/D56062 llvm-svn: 350717
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/test/lit.common.cfg15
-rw-r--r--compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cc5
-rw-r--r--compiler-rt/test/msan/dtls_test.c5
3 files changed, 25 insertions, 0 deletions
diff --git a/compiler-rt/test/lit.common.cfg b/compiler-rt/test/lit.common.cfg
index 975ae29e812..cbd9082805c 100644
--- a/compiler-rt/test/lit.common.cfg
+++ b/compiler-rt/test/lit.common.cfg
@@ -289,6 +289,21 @@ if config.android:
if android_api_level >= 28:
config.available_features.add('android-28')
+if config.host_os == 'Linux':
+ # detect whether we are using glibc, and which version
+ # NB: 'ldd' is just one of the tools commonly installed as part of glibc
+ ldd_ver_cmd = subprocess.Popen(['ldd', '--version'],
+ stdout=subprocess.PIPE,
+ env={'LANG': 'C'})
+ sout, _ = ldd_ver_cmd.communicate()
+ ver_line = sout.splitlines()[0]
+ if ver_line.startswith(b"ldd "):
+ from distutils.version import LooseVersion
+ ver = LooseVersion(ver_line.split()[-1].decode())
+ # 2.27 introduced some incompatibilities
+ if ver >= LooseVersion("2.27"):
+ config.available_features.add("glibc-2.27")
+
sancovcc_path = os.path.join(config.llvm_tools_dir, "sancov")
if os.path.exists(sancovcc_path):
config.available_features.add("has_sancovcc")
diff --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cc b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cc
index 4d70a46f818..8093d6f0e68 100644
--- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cc
+++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cc
@@ -1,4 +1,9 @@
// Test that dynamically allocated TLS space is included in the root set.
+
+// This is known to be broken with glibc-2.27+
+// https://bugs.llvm.org/show_bug.cgi?id=37804
+// XFAIL: glibc-2.27
+
// RUN: LSAN_BASE="report_objects=1:use_stacks=0:use_registers=0:use_ld_allocations=0"
// RUN: %clangxx %s -DBUILD_DSO -fPIC -shared -o %t-so.so
// RUN: %clangxx_lsan %s -o %t
diff --git a/compiler-rt/test/msan/dtls_test.c b/compiler-rt/test/msan/dtls_test.c
index ee91be2ff15..bc1fe609a85 100644
--- a/compiler-rt/test/msan/dtls_test.c
+++ b/compiler-rt/test/msan/dtls_test.c
@@ -11,6 +11,11 @@
// Reports use-of-uninitialized-value, not analyzed
XFAIL: netbsd
+
+ // This is known to be broken with glibc-2.27+
+ // https://bugs.llvm.org/show_bug.cgi?id=37804
+ XFAIL: glibc-2.27
+
*/
#ifndef BUILD_SO
OpenPOWER on IntegriCloud