mirror of
https://github.com/NaC-L/Mergen.git
synced 2026-05-12 09:40:34 +00:00
eb10474eb8
Lifter improvements: - PathSolver.ipp: enhanced path memoization, switch-target diagnostics - GEPTracker.ipp: expanded value tracking, graceful bail-out paths - Semantics_Misc.ipp: clean up CPUID handler (remove dead comments, simplify constant emission) Rewrite infrastructure: - instruction_microtests.json: add jumptable manifest entries (calc_jumptable, jumptable_basic, jumptable_dense) with semantic cases - golden_ir_hashes.json: add hashes for new jumptable samples - build_samples.cmd: support C jumptable /O2 compilation pass - oracle vectors: regenerated (oracle_vectors.json trimmed to current seed set, full-handler vectors updated with new handlers) - run_microtests.cmd / run_all_handlers.cmd: script improvements - test.py: add jumptable semantic cases to coverage Dev scripts: - configure_iced/zydis.cmd, build_iced/zydis.cmd: improved toolchain detection and MERGEN_BUILD_JOBS support Review automation: - format_comment.py, invariant_guard.py, risk_map.py, shard_pr.py: minor fixes aligned with verify_plan public API rename Docs: - REWRITE_BASELINE.md: updated coverage summary and script docs - REVIEWER_RULES.md: minor formatting
85 lines
2.1 KiB
Batchfile
85 lines
2.1 KiB
Batchfile
@echo off
|
|
setlocal
|
|
|
|
:setup
|
|
set "SCRIPT_DIR=%~dp0"
|
|
set "CHECK_FLAGS="
|
|
set "NO_BUILD="
|
|
set "FORCE_BUILD="
|
|
set "FORWARD_ARGS="
|
|
set "MICROTEST_EXE=%SCRIPT_DIR%..\..\build_iced\rewrite_microtests.exe"
|
|
|
|
:parse_args
|
|
if "%~1"=="" goto args_done
|
|
if /I "%~1"=="--check-flags" (
|
|
set "CHECK_FLAGS=1"
|
|
shift
|
|
goto parse_args
|
|
)
|
|
if /I "%~1"=="--no-build" (
|
|
set "NO_BUILD=1"
|
|
shift
|
|
goto parse_args
|
|
)
|
|
if /I "%~1"=="--build" (
|
|
set "FORCE_BUILD=1"
|
|
shift
|
|
goto parse_args
|
|
)
|
|
set "FORWARD_ARGS=%FORWARD_ARGS% %~1"
|
|
shift
|
|
goto parse_args
|
|
|
|
:args_done
|
|
if /I not "%NO_BUILD%"=="1" (
|
|
if /I "%FORCE_BUILD%"=="1" (
|
|
call :build_microtests
|
|
if errorlevel 1 exit /b 1
|
|
) else if not exist "%MICROTEST_EXE%" (
|
|
call :build_microtests
|
|
if errorlevel 1 exit /b 1
|
|
) else (
|
|
echo SKIP microtests build: existing executable "%MICROTEST_EXE%"
|
|
)
|
|
)
|
|
|
|
:ensure_oracle
|
|
if /I not "%SKIP_ORACLE_GENERATION%"=="1" (
|
|
call "%SCRIPT_DIR%generate_oracle_vectors.cmd"
|
|
if errorlevel 1 exit /b 1
|
|
)
|
|
|
|
:ensure_executable
|
|
if not exist "%MICROTEST_EXE%" (
|
|
echo ERROR: rewrite_microtests executable not found at "%MICROTEST_EXE%"
|
|
echo Run "%SCRIPT_DIR%run_microtests.cmd --build" or configure/build build_iced first.
|
|
exit /b 1
|
|
)
|
|
|
|
:run_tests
|
|
if /I "%CHECK_FLAGS%"=="1" (
|
|
set "MERGEN_TEST_CHECK_FLAGS=1"
|
|
echo Enabling strict oracle flag checks
|
|
)
|
|
|
|
"%MICROTEST_EXE%"%FORWARD_ARGS%
|
|
exit /b %errorlevel%
|
|
|
|
:build_microtests
|
|
if not exist "%SCRIPT_DIR%..\..\build_iced\CMakeCache.txt" (
|
|
call "%SCRIPT_DIR%..\dev\configure_iced.cmd"
|
|
if errorlevel 1 exit /b 1
|
|
)
|
|
|
|
set "CMAKE_EXE="
|
|
for /f "usebackq delims=" %%I in (`where cmake 2^>nul`) do if not defined CMAKE_EXE set "CMAKE_EXE=%%I"
|
|
if not defined CMAKE_EXE if exist "C:\Program Files\CMake\bin\cmake.exe" set "CMAKE_EXE=C:\Program Files\CMake\bin\cmake.exe"
|
|
if not defined CMAKE_EXE (
|
|
echo ERROR: CMake executable not found in PATH
|
|
exit /b 1
|
|
)
|
|
|
|
set "BUILD_JOBS=%MERGEN_BUILD_JOBS%"
|
|
if not defined BUILD_JOBS set "BUILD_JOBS=4"
|
|
"%CMAKE_EXE%" --build "%SCRIPT_DIR%..\..\build_iced" --config Release --target rewrite_microtests --parallel %BUILD_JOBS%
|
|
exit /b %errorlevel% |