spack.compilers.clang: add new version check (#14365)

This commit is contained in:
Tim Haines 2020-01-08 00:13:36 -06:00 committed by Massimiliano Culpo
parent 8a82c930bb
commit 2028687efe
2 changed files with 11 additions and 1 deletions

View File

@ -208,7 +208,9 @@ def extract_version_from_output(cls, output):
r'^Apple (?:LLVM|clang) version ([^ )]+)|'
# Normal clang compiler versions are left as-is
r'clang version ([^ )]+)-svn[~.\w\d-]*|'
r'clang version ([^ )]+)-[~.\w\d-]*|'
# Don't include hyphenated patch numbers in the version
# (see https://github.com/spack/spack/pull/14365 for details)
r'clang version ([^ )]+?)-[~.\w\d-]*|'
r'clang version ([^ )]+)',
output
)

View File

@ -348,6 +348,14 @@ def test_fj_flags():
('clang version 8.0.0-3~ubuntu18.04.1 (tags/RELEASE_800/final)\n'
'Target: x86_64-pc-linux-gnu\n'
'Thread model: posix\n'
'InstalledDir: /usr/bin\n', '8.0.0'),
('clang version 9.0.1-+201911131414230800840845a1eea-1~exp1~20191113231141.78\n' # noqa
'Target: x86_64-pc-linux-gnu\n'
'Thread model: posix\n'
'InstalledDir: /usr/bin\n', '9.0.1'),
('clang version 8.0.0-3 (tags/RELEASE_800/final)\n'
'Target: aarch64-unknown-linux-gnu\n'
'Thread model: posix\n'
'InstalledDir: /usr/bin\n', '8.0.0')
])
def test_clang_version_detection(version_str, expected_version):