Fixes PR21000.
Patch by Artem Belevich.
This is a re-take on D7472, but with tests that should not fail on other architectures. The mistake was that changing one assembler would work on all of them. If we only test for the ones we changed, the tests should pass on all targets.