Propagate memory operands when folding test instructions.
This was split from D80062.
Add a test case.
LGTM