teach LIT how to detect the glibc version
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@296942 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py
index 3373dd1..d85db0e 100644
--- a/utils/libcxx/test/config.py
+++ b/utils/libcxx/test/config.py
@@ -401,6 +401,14 @@
if self.is_windows:
self.config.available_features.add('windows')
+ # Attempt to detect the glibc version by querying
+ macros = self.cxx.dumpMacros(flags=['-include', 'features.h'])
+ if macros is not None and '__GLIBC__' in macros:
+ maj_v, min_v = (macros['__GLIBC__'], macros['__GLIBC_MINOR__'])
+ self.config.available_features.add('glibc')
+ self.config.available_features.add('glibc-%s' % maj_v)
+ self.config.available_features.add('glibc-%s.%s' % (maj_v, min_v))
+
def configure_compile_flags(self):
no_default_flags = self.get_lit_bool('no_default_flags', False)
if not no_default_flags: