[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 64/64] tests/tcg/nios2: Add test-shadow-1
From: |
Richard Henderson |
Subject: |
[PATCH v7 64/64] tests/tcg/nios2: Add test-shadow-1 |
Date: |
Thu, 21 Apr 2022 08:17:35 -0700 |
Add a regression test for tcg indirect global lowering.
This appeared with nios2, with cps != 0, so that we use
indirection into the shadow register set. An indirect
call verifies alignment of rA. The use of rA was live
across the brcond leading to a tcg_debug_assert failure.
Cc: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tests/tcg/nios2/Makefile.softmmu-target | 1 +
tests/tcg/nios2/test-shadow-1.S | 37 +++++++++++++++++++++++++
2 files changed, 38 insertions(+)
create mode 100644 tests/tcg/nios2/test-shadow-1.S
diff --git a/tests/tcg/nios2/Makefile.softmmu-target
b/tests/tcg/nios2/Makefile.softmmu-target
index 70664db81c..b5f6a08848 100644
--- a/tests/tcg/nios2/Makefile.softmmu-target
+++ b/tests/tcg/nios2/Makefile.softmmu-target
@@ -27,3 +27,4 @@ QEMU_OPTS = -M 10m50-ghrd,vic=on -semihosting >$@.out -kernel
memory: CFLAGS+=-DCHECK_UNALIGNED=0
TESTS += $(MULTIARCH_TESTS)
+TESTS += test-shadow-1
diff --git a/tests/tcg/nios2/test-shadow-1.S b/tests/tcg/nios2/test-shadow-1.S
new file mode 100644
index 0000000000..33076ddf59
--- /dev/null
+++ b/tests/tcg/nios2/test-shadow-1.S
@@ -0,0 +1,37 @@
+/*
+ * Regresion test for TCG indirect global lowering.
+ */
+
+#include "semicall.h"
+
+ .text
+ .set noat
+ .align 2
+ .globl main
+ .type main, @function
+
+main:
+ /* Initialize r0 in shadow register set 1. */
+ movhi at, 1 /* PRS=1, CRS=0, RSIE=0, PIE=0 */
+ wrctl status, at
+ wrprs zero, zero
+
+ /* Change current register set to 1. */
+ movi at, 1 << 10 /* PRS=0, CRS=1, RSIE=0, PIE=0 */
+ wrctl estatus, at
+ movia ea, 1f
+ eret
+
+ /* Load address for callr, then end TB. */
+1: movia at, 3f
+ br 2f
+
+ /* Test case! TCG abort on indirect lowering across brcond. */
+2: callr at
+
+ /* exit(0) */
+3: movi r4, HOSTED_EXIT
+ movi r5, 0
+ semihosting_call
+
+ .size main, . - main
--
2.34.1
- [PATCH v7 46/64] target/nios2: Drop CR_STATUS_EH from tb->flags, (continued)
- [PATCH v7 46/64] target/nios2: Drop CR_STATUS_EH from tb->flags, Richard Henderson, 2022/04/21
- [PATCH v7 49/64] target/nios2: Hoist set of is_jmp into gen_goto_tb, Richard Henderson, 2022/04/21
- [PATCH v7 50/64] target/nios2: Use gen_goto_tb for DISAS_TOO_MANY, Richard Henderson, 2022/04/21
- [PATCH v7 52/64] target/nios2: Implement Misaligned destination exception, Richard Henderson, 2022/04/21
- [PATCH v7 58/64] linux-user/nios2: Handle various SIGILL exceptions, Richard Henderson, 2022/04/21
- [PATCH v7 61/64] hw/nios2: Move memory regions into Nios2Machine, Richard Henderson, 2022/04/21
- [PATCH v7 56/64] target/nios2: Implement EIC interrupt processing, Richard Henderson, 2022/04/21
- [PATCH v7 55/64] target/nios2: Update helper_eret for shadow registers, Richard Henderson, 2022/04/21
- [PATCH v7 59/64] hw/intc: Vectored Interrupt Controller (VIC), Richard Henderson, 2022/04/21
- [PATCH v7 64/64] tests/tcg/nios2: Add test-shadow-1,
Richard Henderson <=
- [PATCH v7 53/64] target/nios2: Introduce shadow register sets, Richard Henderson, 2022/04/21
- [PATCH v7 60/64] hw/nios2: Introduce Nios2MachineState, Richard Henderson, 2022/04/21
- [PATCH v7 54/64] target/nios2: Implement rdprs, wrprs, Richard Henderson, 2022/04/21
- [PATCH v7 57/64] target/nios2: Advance pc when raising exceptions, Richard Henderson, 2022/04/21
- [PATCH v7 62/64] hw/nios2: Machine with a Vectored Interrupt Controller, Richard Henderson, 2022/04/21
- [PATCH v7 63/64] tests/tcg/nios2: Add semihosting multiarch tests, Richard Henderson, 2022/04/21