capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.18k stars 1.52k forks source link

[Auto-Sync] Smarter MC test generator #2354

Open Rot127 opened 1 month ago

Rot127 commented 1 month ago

Feature

Describe the feature you'd like

The MC regression tests from LLVM are our basis of testing. But generating them is a not simple task. Because we either copy them with grep or some scripts which do the same.

This misses test cases though. And because there are so many it is easy to miss new ones. The test files are difficult to parse, because they don't follow a well defined format.

It would be good to have a different approach to copy the test cases. It should not involve grep or regex with Python. It should guarantee that every regression test from LLVM is in our repo.

Additional context

A possible solution is to run all test cases. Because they are passed to llvm-mc we could add the show-encoding option and parse the output from there (which is easier).