Commit e4bfe6e0f3 for qemu.org

commit e4bfe6e0f360f595e3d278fc4b28aa93c1befb01
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Wed Oct 28 20:25:33 2026 +0100

    tests/tcg/mips64el: Move R5900 tests to system mode and build with meson

    The Makefile needs a toolchain we do not have and qemu-mipsel,
    which no longer provides the R5900 CPU. Move the tests next to
    the bare-metal harness, register them in meson.build, and remove
    the Makefile and the obsolete README.

    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
    Message-ID: <20261028192538.31600-6-philmd@oss.qualcomm.com>

diff --git a/tests/tcg/mips/user/isa/r5900/Makefile b/tests/tcg/mips/user/isa/r5900/Makefile
deleted file mode 100644
index bff360df6c..0000000000
--- a/tests/tcg/mips/user/isa/r5900/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
--include ../../../../config-host.mak
-
-CROSS=mipsr5900el-unknown-linux-gnu-
-
-SIM=qemu-mipsel
-SIM_FLAGS=-cpu R5900
-
-CC      = $(CROSS)gcc
-CFLAGS  = -Wall -mabi=32 -march=r5900 -static
-
-TESTCASES  = test_r5900_div1.tst
-TESTCASES += test_r5900_divu1.tst
-TESTCASES += test_r5900_madd.tst
-TESTCASES += test_r5900_maddu.tst
-TESTCASES += test_r5900_mflohi1.tst
-TESTCASES += test_r5900_mtlohi1.tst
-TESTCASES += test_r5900_mult.tst
-TESTCASES += test_r5900_multu.tst
-
-all: $(TESTCASES)
-
-%.tst: %.c
-	$(CC) $(CFLAGS) $< -o $@
-
-check: $(TESTCASES)
-	@for case in $(TESTCASES); do \
-        echo $(SIM) $(SIM_FLAGS) ./$$case;\
-        $(SIM) $(SIM_FLAGS) ./$$case; \
-	done
-
-clean:
-	$(RM) -rf $(TESTCASES)
diff --git a/tests/tcg/mips/user/isa/r5900/README b/tests/tcg/mips/user/isa/r5900/README
deleted file mode 100644
index 18ecfc3bd0..0000000000
--- a/tests/tcg/mips/user/isa/r5900/README
+++ /dev/null
@@ -1,6 +0,0 @@
-This test suite can't be run at the moment. We don't have a qemu target for this
-architecture, which has single-float arithmetic, and custom 128-bit registers.
-Also, a specific toolchain has to be compiled for it.
-
-We keep the tests here in case someone is interested one day to resurrect this
-architecture.
diff --git a/tests/tcg/mips64el/system/meson.build b/tests/tcg/mips64el/system/meson.build
index 265a2eca4f..c16a21f57a 100644
--- a/tests/tcg/mips64el/system/meson.build
+++ b/tests/tcg/mips64el/system/meson.build
@@ -19,6 +19,26 @@ qemu_args = ['-M', 'none', '-cpu', 'R5900', '-m', '16M',
 gdb_test = ['--gdb-args=-ex "set remoteaddresssize 64"',
             '--test', files('test-r5900.py')]

+# o32: 32-bit pointers, 32-bit GPRs are enough
+foreach t: [
+  'test_r5900_div1.c',
+  'test_r5900_divu1.c',
+  'test_r5900_madd.c',
+  'test_r5900_maddu.c',
+  'test_r5900_mflohi1.c',
+  'test_r5900_mtlohi1.c',
+  'test_r5900_mult.c',
+  'test_r5900_multu.c',
+]
+  tests += {
+    t: {
+      'cflags': cflags + ['-mabi=32'],
+      'qemu_args': qemu_args,
+      'gdb_test': gdb_test,
+    }
+  }
+endforeach
+
 if 'qemu-system-mips64el' in emulators
   tcg_tests += {
     'mips64el-softmmu': {
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_div1.c b/tests/tcg/mips64el/system/test_r5900_div1.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_div1.c
rename to tests/tcg/mips64el/system/test_r5900_div1.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_divu1.c b/tests/tcg/mips64el/system/test_r5900_divu1.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_divu1.c
rename to tests/tcg/mips64el/system/test_r5900_divu1.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_madd.c b/tests/tcg/mips64el/system/test_r5900_madd.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_madd.c
rename to tests/tcg/mips64el/system/test_r5900_madd.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_maddu.c b/tests/tcg/mips64el/system/test_r5900_maddu.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_maddu.c
rename to tests/tcg/mips64el/system/test_r5900_maddu.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_mflohi1.c b/tests/tcg/mips64el/system/test_r5900_mflohi1.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_mflohi1.c
rename to tests/tcg/mips64el/system/test_r5900_mflohi1.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_mtlohi1.c b/tests/tcg/mips64el/system/test_r5900_mtlohi1.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_mtlohi1.c
rename to tests/tcg/mips64el/system/test_r5900_mtlohi1.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_mult.c b/tests/tcg/mips64el/system/test_r5900_mult.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_mult.c
rename to tests/tcg/mips64el/system/test_r5900_mult.c
diff --git a/tests/tcg/mips/user/isa/r5900/test_r5900_multu.c b/tests/tcg/mips64el/system/test_r5900_multu.c
similarity index 100%
rename from tests/tcg/mips/user/isa/r5900/test_r5900_multu.c
rename to tests/tcg/mips64el/system/test_r5900_multu.c