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
19 changes: 8 additions & 11 deletions share/smack/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,14 @@ def find_target(config, options=None):
entries = os.listdir(bcbase)
bcs = []

for entry in entries:
if entry.startswith(target_name + '-') and entry.endswith('.bc'):
bcs.append(bcbase + entry)

bc_file = temporary_file(
os.path.splitext(
os.path.basename(input_file))[0],
'.bc',
args)
try_command([llvm_exact_bin('llvm-link')] + bcs + ['-o', bc_file])
return bc_file
# Matches either target_name.bc or target_name-0123456789abcdef.bc
# depending on platform
target_pattern = target_name + r'(-[a-f0-9]{16})?\.bc'
r = re.compile(target_pattern)
bcs = list(filter(r.match, entries))
assert (len(bcs) == 1)

return bcbase + bcs[0]


def default_rust_compile_args(args):
Expand Down
8 changes: 5 additions & 3 deletions test/regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import time
import sys
import shlex
import pathlib

OVERRIDE_FIELDS = ['verifiers', 'memory', 'time-limit', 'memory-limit', 'skip']
APPEND_FIELDS = ['flags', 'checkbpl', 'checkout']
Expand Down Expand Up @@ -70,11 +71,12 @@ def merge(metadata, yamldata):
def metadata(file):
m = {}
prefix = []
path = pathlib.Path(file)

for d in path.dirname(file).split('/'):
for d in ('./',) + path.parent.parts:
prefix += [d]
yaml_file = path.join(*(prefix + ['config.yml']))
if path.isfile(yaml_file):
yaml_file = pathlib.Path(*(prefix + ['config.yml']))
if yaml_file.is_file():
with open(yaml_file, "r") as f:
data = yaml.safe_load(f)
merge(m, data)
Expand Down