[LegalizeDAG] Fix ATOMIC_CMP_SWAP_WITH_SUCCESS legalization.

The code wasn't zero-extending correctly, so the comparison could
spuriously fail.

Adds some AArch64 tests to cover this case.

Inspired by D41791.

Differential Revision: https://reviews.llvm.org/D41798



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322767 91177308-0d34-0410-b5e6-96231b3b80d8
5 files changed