aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2022-04-25 17:16:01 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2022-05-06 15:27:40 -0700
commit64407f6a9e0731c11a65119b7372dbe5b3a42eb9 (patch)
tree643bcc7b05acf59e3e7a09e92c6c07ac217c38ad /tests/tcg
parent8164f14bb98dce986b755af4b3dfee3eb99c95a1 (diff)
tests/tcg/xtensa: fix watchpoint test
xtensa core may have only one set of DBREAKA/DBREAKC registers. Don't hardcode register numbers in the test as 0 and 1, use macros that only index valid DBREAK* registers. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'tests/tcg')
-rw-r--r--tests/tcg/xtensa/test_break.S86
1 files changed, 46 insertions, 40 deletions
diff --git a/tests/tcg/xtensa/test_break.S b/tests/tcg/xtensa/test_break.S
index 3379a3f9f0..3aa18b5cec 100644
--- a/tests/tcg/xtensa/test_break.S
+++ b/tests/tcg/xtensa/test_break.S
@@ -200,64 +200,70 @@ test_end
.endm
#if XCHAL_NUM_DBREAK
+#define DB0 0
+#if XCHAL_NUM_DBREAK > 1
+#define DB1 1
+#else
+#define DB1 0
+#endif
test dbreak_exact
- dbreak_test 0, 0x4000003f, 0xd000007f, 0xd000007f, l8ui
- dbreak_test 1, 0x4000003e, 0xd000007e, 0xd000007e, l16ui
- dbreak_test 0, 0x4000003c, 0xd000007c, 0xd000007c, l32i
+ dbreak_test DB0, 0x4000003f, 0xd000007f, 0xd000007f, l8ui
+ dbreak_test DB1, 0x4000003e, 0xd000007e, 0xd000007e, l16ui
+ dbreak_test DB0, 0x4000003c, 0xd000007c, 0xd000007c, l32i
- dbreak_test 1, 0x8000003f, 0xd000007f, 0xd000007f, s8i
- dbreak_test 0, 0x8000003e, 0xd000007e, 0xd000007e, s16i
- dbreak_test 1, 0x8000003c, 0xd000007c, 0xd000007c, s32i
+ dbreak_test DB1, 0x8000003f, 0xd000007f, 0xd000007f, s8i
+ dbreak_test DB0, 0x8000003e, 0xd000007e, 0xd000007e, s16i
+ dbreak_test DB1, 0x8000003c, 0xd000007c, 0xd000007c, s32i
test_end
-test dbreak_overlap
- dbreak_test 0, 0x4000003f, 0xd000007d, 0xd000007c, l16ui
- dbreak_test 1, 0x4000003f, 0xd000007d, 0xd000007c, l32i
+test DBdbreak_overlap
+ dbreak_test DB0, 0x4000003f, 0xd000007d, 0xd000007c, l16ui
+ dbreak_test DB1, 0x4000003f, 0xd000007d, 0xd000007c, l32i
- dbreak_test 0, 0x4000003e, 0xd000007e, 0xd000007f, l8ui
- dbreak_test 1, 0x4000003e, 0xd000007e, 0xd000007c, l32i
+ dbreak_test DB0, 0x4000003e, 0xd000007e, 0xd000007f, l8ui
+ dbreak_test DB1, 0x4000003e, 0xd000007e, 0xd000007c, l32i
- dbreak_test 0, 0x4000003c, 0xd000007c, 0xd000007d, l8ui
- dbreak_test 1, 0x4000003c, 0xd000007c, 0xd000007c, l16ui
+ dbreak_test DB0, 0x4000003c, 0xd000007c, 0xd000007d, l8ui
+ dbreak_test DB1, 0x4000003c, 0xd000007c, 0xd000007c, l16ui
- dbreak_test 0, 0x40000038, 0xd0000078, 0xd000007b, l8ui
- dbreak_test 1, 0x40000038, 0xd0000078, 0xd000007a, l16ui
- dbreak_test 0, 0x40000038, 0xd0000078, 0xd000007c, l32i
+ dbreak_test DB0, 0x40000038, 0xd0000078, 0xd000007b, l8ui
+ dbreak_test DB1, 0x40000038, 0xd0000078, 0xd000007a, l16ui
+ dbreak_test DB0, 0x40000038, 0xd0000078, 0xd000007c, l32i
- dbreak_test 1, 0x40000030, 0xd0000070, 0xd0000075, l8ui
- dbreak_test 0, 0x40000030, 0xd0000070, 0xd0000076, l16ui
- dbreak_test 1, 0x40000030, 0xd0000070, 0xd0000078, l32i
+ dbreak_test DB1, 0x40000030, 0xd0000070, 0xd0000075, l8ui
+ dbreak_test DB0, 0x40000030, 0xd0000070, 0xd0000076, l16ui
+ dbreak_test DB1, 0x40000030, 0xd0000070, 0xd0000078, l32i
- dbreak_test 0, 0x40000020, 0xd0000060, 0xd000006f, l8ui
- dbreak_test 1, 0x40000020, 0xd0000060, 0xd0000070, l16ui
- dbreak_test 0, 0x40000020, 0xd0000060, 0xd0000074, l32i
+ dbreak_test DB0, 0x40000020, 0xd0000060, 0xd000006f, l8ui
+ dbreak_test DB1, 0x40000020, 0xd0000060, 0xd0000070, l16ui
+ dbreak_test DB0, 0x40000020, 0xd0000060, 0xd0000074, l32i
- dbreak_test 0, 0x8000003f, 0xd000007d, 0xd000007c, s16i
- dbreak_test 1, 0x8000003f, 0xd000007d, 0xd000007c, s32i
+ dbreak_test DB0, 0x8000003f, 0xd000007d, 0xd000007c, s16i
+ dbreak_test DB1, 0x8000003f, 0xd000007d, 0xd000007c, s32i
- dbreak_test 0, 0x8000003e, 0xd000007e, 0xd000007f, s8i
- dbreak_test 1, 0x8000003e, 0xd000007e, 0xd000007c, s32i
+ dbreak_test DB0, 0x8000003e, 0xd000007e, 0xd000007f, s8i
+ dbreak_test DB1, 0x8000003e, 0xd000007e, 0xd000007c, s32i
- dbreak_test 0, 0x8000003c, 0xd000007c, 0xd000007d, s8i
- dbreak_test 1, 0x8000003c, 0xd000007c, 0xd000007c, s16i
+ dbreak_test DB0, 0x8000003c, 0xd000007c, 0xd000007d, s8i
+ dbreak_test DB1, 0x8000003c, 0xd000007c, 0xd000007c, s16i
- dbreak_test 0, 0x80000038, 0xd0000078, 0xd000007b, s8i
- dbreak_test 1, 0x80000038, 0xd0000078, 0xd000007a, s16i
- dbreak_test 0, 0x80000038, 0xd0000078, 0xd000007c, s32i
+ dbreak_test DB0, 0x80000038, 0xd0000078, 0xd000007b, s8i
+ dbreak_test DB1, 0x80000038, 0xd0000078, 0xd000007a, s16i
+ dbreak_test DB0, 0x80000038, 0xd0000078, 0xd000007c, s32i
- dbreak_test 1, 0x80000030, 0xd0000070, 0xd0000075, s8i
- dbreak_test 0, 0x80000030, 0xd0000070, 0xd0000076, s16i
- dbreak_test 1, 0x80000030, 0xd0000070, 0xd0000078, s32i
+ dbreak_test DB1, 0x80000030, 0xd0000070, 0xd0000075, s8i
+ dbreak_test DB0, 0x80000030, 0xd0000070, 0xd0000076, s16i
+ dbreak_test DB1, 0x80000030, 0xd0000070, 0xd0000078, s32i
- dbreak_test 0, 0x80000020, 0xd0000060, 0xd000006f, s8i
- dbreak_test 1, 0x80000020, 0xd0000060, 0xd0000070, s16i
- dbreak_test 0, 0x80000020, 0xd0000060, 0xd0000074, s32i
+ dbreak_test DB0, 0x80000020, 0xd0000060, 0xd000006f, s8i
+ dbreak_test DB1, 0x80000020, 0xd0000060, 0xd0000070, s16i
+ dbreak_test DB0, 0x80000020, 0xd0000060, 0xd0000074, s32i
test_end
-test dbreak_invalid
- dbreak_test 0, 0x40000030, 0xd0000071, 0xd0000070, l16ui
- dbreak_test 1, 0x40000035, 0xd0000072, 0xd0000070, l32i
+test DBdbreak_invalid
+ dbreak_test DB0, 0x40000030, 0xd0000071, 0xd0000070, l16ui
+ dbreak_test DB1, 0x40000035, 0xd0000072, 0xd0000070, l32i
test_end
#endif