diff mbox

[3/4] target-xtensa: add test for LEND invalidation

Message ID 1333666012-16094-4-git-send-email-jcmvbkbc@gmail.com
State New
Headers show

Commit Message

Max Filippov April 5, 2012, 10:46 p.m. UTC
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 tests/tcg/xtensa/test_loop.S |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/tests/tcg/xtensa/test_loop.S b/tests/tcg/xtensa/test_loop.S
index a5ea933..9ebc18d 100644
--- a/tests/tcg/xtensa/test_loop.S
+++ b/tests/tcg/xtensa/test_loop.S
@@ -74,4 +74,29 @@  test loop_excm
     assert  eqi, a2, 1
 test_end
 
+test loop_invalidation
+    movi    a2, 0
+    movi    a3, 5
+    movi    a4, 1f
+    movi    a5, 2f
+    wsr     a3, lcount
+    wsr     a4, lbeg
+    wsr     a5, lend
+    isync
+    j       1f
+.align 4
+1:
+    addi    a2, a2, 1
+2:
+    beqi    a3, 3, 1f
+    assert  eqi, a2, 6
+    movi    a3, 3
+    wsr     a3, lcount
+    wsr     a4, lend
+    isync
+    j       1b
+1:
+    assert  eqi, a2, 7
+test_end
+
 test_suite_end