From 294bfce8a1ca2fc501b8939292146e44f813a2b8 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Mon, 9 Jul 2018 14:25:46 -0700 Subject: [PATCH] Check that SC yields the load reservation https://github.com/riscv/riscv-isa-manual/commit/03a5e722fc0fe7b94dd0a49f550ff7b41a63f612 --- isa/rv64ua/lrsc.S | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.30.2