Skip to content

Commit

Permalink
Fix lock_xchg* test to return 1 on failure
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <alan.jowett@microsoft.com>
  • Loading branch information
Alan Jowett committed May 28, 2024
1 parent 7c2ef8b commit bae77c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions tests/lock_xchg.data
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT
-- asm
mov %r0, 0
mov %r0, 1
# Write 0x1111111111111111 to [%r10-8]
lddw %r1, 0x1111111111111111
stxdw [%r10-8], %r1
Expand All @@ -10,9 +10,6 @@ lddw %r1, 0x2222222222222222
# After the exchange, %r1 should contain 0x1111111111111111 and
# [%r10-8] should contain 0x2222222222222222
lock xchg [%r10-8], %r1
# Check that the old value is stored in %r0
lddw %r2, 0x1111111111111111
jne %r2, %r0, exit
# Check that [%r10-8] contains 0x2222222222222222
ldxdw %r2, [%r10-8]
lddw %r0, 0x2222222222222222
Expand Down
5 changes: 1 addition & 4 deletions tests/lock_xchg32.data
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT
-- asm
mov %r0, 0
mov %r0, 1
# Write 0x1111111111111111 to [%r10-8]
lddw %r1, 0x1111111111111111
stxdw [%r10-8], %r1
Expand All @@ -10,9 +10,6 @@ lddw %r1, 0x2222222222222222
# After the exchange, %r1 should contain 0x11111111 and
# [%r10-8] should contain 0x1111111122222222
lock xchg32 [%r10-8], %r1
# Check that the old value is stored in %r0
lddw %r2, 0x11111111
jne %r2, %r0, exit
# Check that [%r10-8] contains 0x1111111122222222
ldxdw %r2, [%r10-8]
lddw %r0, 0x1111111122222222
Expand Down

0 comments on commit bae77c7

Please sign in to comment.