Skip to content

Commit

Permalink
[vm] Fix clobbered THR/R14 in StoreReleaseLoadAcquire[1204] tests.
Browse files Browse the repository at this point in the history
TEST=ci
Change-Id: I8297d630b47c422b420d3d3bc8d2a6876d446eaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397421
Commit-Queue: Ryan Macnak <[email protected]>
Reviewed-by: Alexander Aprelev <[email protected]>
  • Loading branch information
rmacnak-google authored and Commit Queue committed Nov 25, 2024
1 parent 4b2b0a8 commit e08ce93
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions runtime/vm/compiler/assembler/assembler_x64_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6229,12 +6229,10 @@ IMMEDIATE_TEST(AddrImmRAXByte,
__ popq(RAX))

ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire, assembler) {
if (FLAG_target_thread_sanitizer) {
// On TSAN builds StoreRelease/LoadAcquire will do a runtime
// call to tell TSAN about our action.
__ MoveRegister(THR, CallingConventions::kArg2Reg);
}

// On TSAN builds StoreRelease/LoadAcquire will do a runtime
// call to tell TSAN about our action.
__ pushq(THR);
__ MoveRegister(THR, CallingConventions::kArg2Reg);
__ pushq(RCX);
__ xorq(RCX, RCX);
__ pushq(RCX);
Expand Down Expand Up @@ -6299,6 +6297,7 @@ ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire, assembler) {
__ LoadAcquireFromOffset(CallingConventions::kReturnReg, RSP, 0);
__ popq(RCX);
__ popq(RCX);
__ popq(THR);
__ ret();
}

Expand All @@ -6308,12 +6307,10 @@ ASSEMBLER_TEST_RUN(StoreReleaseLoadAcquire, test) {
}

ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire1024, assembler) {
if (FLAG_target_thread_sanitizer) {
// On TSAN builds StoreRelease/LoadAcquire will do a runtime
// call to tell TSAN about our action.
__ MoveRegister(THR, CallingConventions::kArg2Reg);
}

// On TSAN builds StoreRelease/LoadAcquire will do a runtime
// call to tell TSAN about our action.
__ pushq(THR);
__ MoveRegister(THR, CallingConventions::kArg2Reg);
__ pushq(RCX);
__ xorq(RCX, RCX);
__ pushq(RCX);
Expand All @@ -6323,6 +6320,7 @@ ASSEMBLER_TEST_GENERATE(StoreReleaseLoadAcquire1024, assembler) {
__ addq(RSP, Immediate(1024));
__ popq(RCX);
__ popq(RCX);
__ popq(THR);
__ ret();
}

Expand Down

0 comments on commit e08ce93

Please sign in to comment.