]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/tools/gold/X86/v1.12/lit.local.cfg
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / tools / gold / X86 / v1.12 / lit.local.cfg
1 import re
2 import subprocess
3
4 def is_gold_v1_12_linker_available():
5
6   if not config.gold_executable:
7     return False
8   try:
9     ld_cmd = subprocess.Popen([config.gold_executable, '-v'],
10                               stdout = subprocess.PIPE,
11                               stderr = subprocess.PIPE)
12     ld_out, _ = ld_cmd.communicate()
13     ld_out = ld_out.decode()
14   except:
15     return False
16
17   match = re.search(r'GNU gold \(.*\) (\d+)\.(\d+)', ld_out)
18   if not match:
19     return False
20   major = int(match.group(1))
21   minor = int(match.group(2))
22   if major < 1 or (major == 1 and minor < 12):
23     return False
24
25   return True
26
27 if not is_gold_v1_12_linker_available():
28   config.unsupported = True