From: Andrew Waterman Date: Mon, 9 Jul 2018 21:25:46 +0000 (-0700) Subject: Check that SC yields the load reservation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=294bfce8a1ca2fc501b8939292146e44f813a2b8;p=riscv-tests.git Check that SC yields the load reservation https://github.com/riscv/riscv-isa-manual/commit/03a5e722fc0fe7b94dd0a49f550ff7b41a63f612 --- diff --git a/isa/rv64ua/lrsc.S b/isa/rv64ua/lrsc.S index 14ef07d..f73a404 100644 --- a/isa/rv64ua/lrsc.S +++ b/isa/rv64ua/lrsc.S @@ -70,6 +70,15 @@ TEST_CASE( 4, a0, 0, \ bgez a3, 1b ) +# make sure that sc-after-successful-sc fails. +TEST_CASE( 5, a1, 1, \ + la a0, foo; \ +1:lr.w a1, (a0); \ + sc.w a1, x0, (a0); \ + bnez a1, 1b; \ + sc.w a1, x0, (a0) +) + TEST_PASSFAIL RVTEST_CODE_END