Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions lnt/testing/util/compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def get_cc_info(path, cc_flags=[]):
logger.error("unable to find compiler version: %r: %r" %
(cc, cc_version))
else:
m = re.match(r'(.*) version ([^ ]*) (?:[0-9]+ )?+(\([^(]*\))(.*)',
version_ln)
m = re.match(r'(.*) version ([^ ]*) +(\([^(]*\))(.*)', version_ln)
if m is not None:
cc_name, cc_version_num, cc_build_string, cc_extra = m.groups()
else:
Expand Down Expand Up @@ -105,17 +104,15 @@ def get_cc_info(path, cc_flags=[]):
cc_src_tag = cc_version_num

elif cc_name == 'gcc' and (cc_extra == '' or
cc_extra == '(GCC)' or
re.match(r' \(dot [0-9]+\)', cc_extra)):
cc_norm_name = 'gcc'
m = re.match(r'\(Apple Inc. build ([0-9]*)\)', cc_build_string)
if m:
cc_build = 'PROD'
cc_src_tag, = m.groups()
elif 'experimental' in cc_build_string:
cc_build = 'DEV'
else:
cc_build = 'PROD'
logger.error('unable to determine gcc build version: %r' %
cc_build_string)
elif (cc_name in ('clang', 'LLVM', 'Debian clang', 'Apple clang',
'Apple LLVM') and
(cc_extra == '' or 'based on LLVM' in cc_extra or
Expand Down
22 changes: 0 additions & 22 deletions tests/SharedInputs/FakeCompilers/fakecompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,6 @@ def print_verbose_info(self):
"%s" "-cc1" "-E" ... more boring stuff here ...""" % (
g_program,), file=sys.stderr)

class GCCDebian(FakeCompiler):
compiler_name = "gcc-debian"

def print_verbose_info(self):
print("""\
Target: x86_64-linux-gnu
gcc version 12.2.0 (Debian 12.2.0-14+deb12u1)""", file=sys.stderr)

def print_dumpmachine(self):
print("x86_64-linux-gnu")

class GCCTrunk(FakeCompiler):
compiler_name = "gcc-trunk"

def print_verbose_info(self):
print("""\
Target: x86_64-linux-gnu
gcc version 16.0.0 20250807 (experimental) (GCC)""", file=sys.stderr)

def print_dumpmachine(self):
print("x86_64-linux-gnu")


fake_compilers = dict((value.compiler_name, value)
for key, value in locals().items()
Expand Down
1 change: 0 additions & 1 deletion tests/SharedInputs/FakeCompilers/gcc-debian

This file was deleted.

1 change: 0 additions & 1 deletion tests/SharedInputs/FakeCompilers/gcc-trunk

This file was deleted.

16 changes: 0 additions & 16 deletions tests/testing/Compilers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,3 @@ def get_info(name):
pprint.pprint(info)
assert info['cc_name'] == 'clang'
assert info['cc_version_number'] == '3.2'

# Check a GCC packaged from Debian.
info = get_info("gcc-debian")
pprint.pprint(info)
assert info['cc_name'] == 'gcc'
assert info['cc_build'] == 'PROD'
assert info['cc_version_number'] == '12.2.0'
assert info['cc_target'] == 'x86_64-linux-gnu'

# Check a GCC built from trunk.
info = get_info("gcc-trunk")
pprint.pprint(info)
assert info['cc_name'] == 'gcc'
assert info['cc_build'] == 'DEV'
assert info['cc_version_number'] == '16.0.0'
assert info['cc_target'] == 'x86_64-linux-gnu'