Commit 22b35941f0 for qemu.org

commit 22b35941f0216b997ea93f8f5c67fa97daf0ceae
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date:   Tue Sep 29 21:24:34 2026 +0000

    tests/tcg/mips64: add mips64r6(el) tests

    We need to define two new test suites mips64r6-linux-user and
    mips64r6el-linux-user to be able to use a different compiler from
    mips64-linux-user, as cc is setup only once per suite.

    Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Link: https://lore.kernel.org/qemu-devel/20260929212439.110454-20-pierrick.bouvier@oss.qualcomm.com
    Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>

diff --git a/meson_options.txt b/meson_options.txt
index e6dd64b5a8..07b016c0fd 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -445,6 +445,14 @@ option('tcg_tests_cross_cc_mips64', type: 'string',
        description: 'cc for mips64 tcg tests')
 option('tcg_tests_cross_cflags_mips64', type: 'string',
        description: 'cflags for mips64 tcg tests')
+option('tcg_tests_cross_cc_mips64r6', type: 'string',
+       description: 'cc for mips64r6 tcg tests')
+option('tcg_tests_cross_cflags_mips64r6', type: 'string',
+       description: 'cflags for mips64r6 tcg tests')
+option('tcg_tests_cross_cc_mips64r6el', type: 'string',
+       description: 'cc for mips64r6el tcg tests')
+option('tcg_tests_cross_cflags_mips64r6el', type: 'string',
+       description: 'cflags for mips64r6el tcg tests')
 option('tcg_tests_cross_cc_mips64el', type: 'string',
        description: 'cc for mips64el tcg tests')
 option('tcg_tests_cross_cflags_mips64el', type: 'string',
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index b46005ee96..4076a7f6b5 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -540,6 +540,8 @@ _meson_option_parse() {
     --tcg-tests-cross-cc-mips=*) quote_sh "-Dtcg_tests_cross_cc_mips=$2" ;;
     --tcg-tests-cross-cc-mips64=*) quote_sh "-Dtcg_tests_cross_cc_mips64=$2" ;;
     --tcg-tests-cross-cc-mips64el=*) quote_sh "-Dtcg_tests_cross_cc_mips64el=$2" ;;
+    --tcg-tests-cross-cc-mips64r6=*) quote_sh "-Dtcg_tests_cross_cc_mips64r6=$2" ;;
+    --tcg-tests-cross-cc-mips64r6el=*) quote_sh "-Dtcg_tests_cross_cc_mips64r6el=$2" ;;
     --tcg-tests-cross-cc-mipsel=*) quote_sh "-Dtcg_tests_cross_cc_mipsel=$2" ;;
     --tcg-tests-cross-cc-or1k=*) quote_sh "-Dtcg_tests_cross_cc_or1k=$2" ;;
     --tcg-tests-cross-cc-ppc64=*) quote_sh "-Dtcg_tests_cross_cc_ppc64=$2" ;;
@@ -563,6 +565,8 @@ _meson_option_parse() {
     --tcg-tests-cross-cflags-mips=*) quote_sh "-Dtcg_tests_cross_cflags_mips=$2" ;;
     --tcg-tests-cross-cflags-mips64=*) quote_sh "-Dtcg_tests_cross_cflags_mips64=$2" ;;
     --tcg-tests-cross-cflags-mips64el=*) quote_sh "-Dtcg_tests_cross_cflags_mips64el=$2" ;;
+    --tcg-tests-cross-cflags-mips64r6=*) quote_sh "-Dtcg_tests_cross_cflags_mips64r6=$2" ;;
+    --tcg-tests-cross-cflags-mips64r6el=*) quote_sh "-Dtcg_tests_cross_cflags_mips64r6el=$2" ;;
     --tcg-tests-cross-cflags-mipsel=*) quote_sh "-Dtcg_tests_cross_cflags_mipsel=$2" ;;
     --tcg-tests-cross-cflags-or1k=*) quote_sh "-Dtcg_tests_cross_cflags_or1k=$2" ;;
     --tcg-tests-cross-cflags-ppc64=*) quote_sh "-Dtcg_tests_cross_cflags_ppc64=$2" ;;
diff --git a/tests/tcg/mips64/meson.build b/tests/tcg/mips64/meson.build
index f08d118257..676a47f5c8 100644
--- a/tests/tcg/mips64/meson.build
+++ b/tests/tcg/mips64/meson.build
@@ -23,3 +23,60 @@ if 'qemu-mips64' in emulators
     }
   }
 endif
+
+tests = []
+
+tests_mips64r6 = [
+  '../mips64/test_mips64r6_and.c',
+  '../mips64/test_mips64r6_bitswap.c',
+  '../mips64/test_mips64r6_clo.c',
+  '../mips64/test_mips64r6_clz.c',
+  '../mips64/test_mips64r6_crc32b.c',
+  '../mips64/test_mips64r6_crc32cb.c',
+  '../mips64/test_mips64r6_crc32cd.c',
+  '../mips64/test_mips64r6_crc32ch.c',
+  '../mips64/test_mips64r6_crc32cw.c',
+  '../mips64/test_mips64r6_crc32d.c',
+  '../mips64/test_mips64r6_crc32h.c',
+  '../mips64/test_mips64r6_crc32w.c',
+  '../mips64/test_mips64r6_dbitswap.c',
+  '../mips64/test_mips64r6_dclo.c',
+  '../mips64/test_mips64r6_dclz.c',
+  '../mips64/test_mips64r6_dmuh.c',
+  '../mips64/test_mips64r6_dmuhu.c',
+  '../mips64/test_mips64r6_dmul.c',
+  '../mips64/test_mips64r6_dmulu.c',
+  '../mips64/test_mips64r6_dsllv.c',
+  '../mips64/test_mips64r6_dsrav.c',
+  '../mips64/test_mips64r6_dsrlv.c',
+  '../mips64/test_mips64r6_muh.c',
+  '../mips64/test_mips64r6_muhu.c',
+  '../mips64/test_mips64r6_mul.c',
+  '../mips64/test_mips64r6_mulu.c',
+  '../mips64/test_mips64r6_nor.c',
+  '../mips64/test_mips64r6_or.c',
+  '../mips64/test_mips64r6_sllv.c',
+  '../mips64/test_mips64r6_srav.c',
+  '../mips64/test_mips64r6_srlv.c',
+  '../mips64/test_mips64r6_xor.c',
+]
+
+foreach src: tests_mips64r6
+  tests += {src: {'cflags': '-march=mips64r6'}}
+endforeach
+
+# export tests for mips64el
+tcg_tests_mips64r6 = tests
+
+if 'qemu-mips64' in emulators
+  tcg_tests += {
+    'mips64r6-linux-user': {
+      'cc': 'mipsisa64r6-linux-gnuabi64-gcc',
+      'cc_dockerfile': 'debian-all-test-cross',
+      'folder': 'mips64',
+      'gdb_arch': 'mips64',
+      'qemu': emulators['qemu-mips64'],
+      'tests': tcg_tests_mips64r6,
+    }
+  }
+endif
diff --git a/tests/tcg/mips64el/meson.build b/tests/tcg/mips64el/meson.build
index d74c7de9b7..606f300804 100644
--- a/tests/tcg/mips64el/meson.build
+++ b/tests/tcg/mips64el/meson.build
@@ -9,4 +9,15 @@ if 'qemu-mips64el' in emulators
       'tests': tcg_tests_mips64,
     }
   }
+
+  tcg_tests += {
+    'mips64r6el-linux-user': {
+      'cc': 'mipsisa64r6el-linux-gnuabi64-gcc',
+      'cc_dockerfile': 'debian-all-test-cross',
+      'folder': 'mips64el',
+      'gdb_arch': 'mips64el',
+      'qemu': emulators['qemu-mips64el'],
+      'tests': tcg_tests_mips64r6,
+    }
+  }
 endif