This enables the "-assemble" feature for llvm-mc-fuzzer.
Currently we just attempt assembly and ignore the result.
Differential D30156
llvm-mc-fuzzer: add support for assembly bcain on Feb 19 2017, 9:09 AM. Authored by
Details
Diff Detail
Event TimelineComment Actions The code mostly looks good, but I am not an expert in the used APIs, hopefully someone else chimes in.
Comment Actions
Ignoring the result is the right thing to do since failure to assemble is an expected response to some inputs. Whether it's a correct response to a particular input can be found by separately running the corpus through the assembler and comparing against a reference (most likely, another assembler).
Comment Actions Suggested changes:
Comment Actions I think I've satisfied all of the review concerns, save the one about reinterpret_cast. Daniel, please let me know if the comment was just informative or if you prefer a change there.
Comment Actions Just to make sure we're all on the same page, I think anything leveraging a reference assembler is out of scope (for now anyways). Comment Actions That's right. Crashes aside, it's not llvm-mc-fuzzers job to check the correctness of any particular output. The comment about a reference assembler was meant to indicate how someone would check correctness externally using the corpus emitted by llvm-mc-fuzzer.
Comment Actions Looks good. We can iterate after this version is submitted.
|
reinterpret_cast tends to cause portability problems but this one is ok for the targets LLVM supports in-tree as far as I know.