Adds a test to check for the correct state of the gather instruction's mask register if an asynchronous event hits the sequence after a completed load, but before the mask register update. Note that the restore event is not implemented yet, and the test is currently expected to report an error.
Re-factors the tests and puts the functions test_avx512_restore_mask_fault, test_avx512_restore_mask_clobber, and test_avx512_restore_mask_update in one common macro.
A future patch that will add support for restoring the mask register will also include an update to this test.
Issue: #2985 (closed)