[FuzzMutate] Correct type cast and add unit test for FCmp
authorZhenkai Weng <theoaktree1040@gmail.com>
Fri, 21 Apr 2023 23:35:45 +0000 (16:35 -0700)
committerPeter Rong <PeterRong96@gmail.com>
Wed, 26 Apr 2023 00:29:00 +0000 (17:29 -0700)
commit1f67602222cc8668151f1e5d66cb99524f6dc236
tree1c6de3c5bacbf12b770bdda6bc2feab633850669
parent0f9b1c8872ef0bb041b301f9932d3f0be180f425
[FuzzMutate] Correct type cast and add unit test for FCmp

This revision fixes an incorrect type cast from Instruction to ICmpInstr, which should have been to FCmpInstr instead. It turns out that StrategiesTest.cpp was missing a test case for InstModificationIRStrategy and FCmp, which is also now implemented in this revision. After this revision, [[ https://reviews.llvm.org/D148854 | llvm-stress in D148854 ]] no longer crashes randomly.

Reviewed By: Peter

Differential Revision: https://reviews.llvm.org/D148972
llvm/lib/FuzzMutate/IRMutator.cpp
llvm/unittests/FuzzMutate/StrategiesTest.cpp