[CI][lit] Enable roundtrip tests in CI (#7377)

This PR adds a round trip tests In CI. This could slightly increase the test time but it's
ignorable compared to build time. 

cf. a6d09d4b1a

Close https://github.com/llvm/circt/issues/5272
This commit is contained in:
Hideto Ueno 2024-07-24 01:16:58 +09:00 committed by GitHub
parent 7b8b339548
commit e8033f1928
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 3 deletions

View File

@ -222,7 +222,7 @@ jobs:
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DLLVM_LIT_ARGS="-v" \
-DCIRCT_SLANG_FRONTEND_ENABLED=ON
ninja check-circt check-circt-unit -j$(nproc)
CIRCT_OPT_CHECK_IR_ROUNDTRIP=1 ninja check-circt check-circt-unit -j$(nproc)
ninja circt-doc
# --------

View File

@ -51,6 +51,8 @@ config.test_exec_root = os.path.join(config.circt_obj_root, 'test')
# Tweak the PATH to include the tools dir.
llvm_config.with_environment('PATH', config.llvm_tools_dir, append_path=True)
llvm_config.with_environment('PATH', config.mlir_tools_dir, append_path=True)
llvm_config.with_environment('PATH', config.circt_tools_dir, append_path=True)
tool_dirs = [
config.circt_tools_dir, config.mlir_tools_dir, config.llvm_tools_dir
@ -58,10 +60,18 @@ tool_dirs = [
tools = [
'arcilator', 'circt-as', 'circt-capi-ir-test', 'circt-capi-om-test',
'circt-capi-firrtl-test', 'circt-capi-firtool-test', 'circt-dis',
'circt-opt', 'circt-reduce', 'circt-translate', 'firtool', 'hlstool',
'om-linker', 'ibistool'
'circt-reduce', 'circt-translate', 'firtool', 'hlstool', 'om-linker',
'ibistool'
]
if "CIRCT_OPT_CHECK_IR_ROUNDTRIP" in os.environ:
tools.extend([
ToolSubst("circt-opt", "circt-opt --verify-roundtrip",
unresolved="fatal"),
])
else:
tools.extend(["circt-opt"])
# Enable Verilator if it has been detected.
if config.verilator_path != "":
tool_dirs.append(os.path.dirname(config.verilator_path))