aboutsummaryrefslogtreecommitdiff
path: root/isa
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2023-04-06 21:40:30 -0700
committerAndrew Waterman <andrew@sifive.com>2023-04-06 21:40:30 -0700
commit394937eceb62bc4ba8ad5a4e916f0508d9803229 (patch)
tree8eecd948f2ea9b49f182f2e07f774c195437c2fe /isa
parentaaae4e7d20831ac8383350ff8c859994012f3528 (diff)
downloadriscv-tests-394937eceb62bc4ba8ad5a4e916f0508d9803229.zip
riscv-tests-394937eceb62bc4ba8ad5a4e916f0508d9803229.tar.gz
riscv-tests-394937eceb62bc4ba8ad5a4e916f0508d9803229.tar.bz2
Augment LR/SC test to test that SC-after-failed-SC fails
Diffstat (limited to 'isa')
-rw-r--r--isa/rv64ua/lrsc.S7
1 files changed, 5 insertions, 2 deletions
diff --git a/isa/rv64ua/lrsc.S b/isa/rv64ua/lrsc.S
index 5711f8d..ab0d025 100644
--- a/isa/rv64ua/lrsc.S
+++ b/isa/rv64ua/lrsc.S
@@ -83,12 +83,15 @@ TEST_CASE( 5, a0, 0, \
)
# make sure that sc-after-successful-sc fails.
-TEST_CASE( 6, a1, 1, \
+TEST_CASE( 6, a1, 2, \
la a0, foo; \
1:lr.w a1, (a0); \
sc.w a1, x0, (a0); \
bnez a1, 1b; \
- sc.w a1, x0, (a0)
+ sc.w a1, x0, (a0); \
+ /* make sure that sc-after-failed-sc fails, too */ \
+ sc.w a2, x0, (a0); \
+ add a1, a1, a2
)
TEST_PASSFAIL