Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AED6606A320 for ; Mon, 30 Nov 2026 20:17:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=dShEu6/3 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xY7o0-0002GC-NO; Mon, 30 Nov 2026 15:16:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xY7nj-00027B-Qp for qemu-arm@nongnu.org; Mon, 30 Nov 2026 15:16:49 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xY7nc-0003Zb-0Z for qemu-arm@nongnu.org; Mon, 30 Nov 2026 15:16:39 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4bb64c99d2fso98488145e9.3 for ; Mon, 30 Nov 2026 12:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1796069786; x=1796674586; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3SxkjN7pJLG51kHGvwtC//rz3oh/sVmK9gm/E1cu04g=; b=dShEu6/3arfuGtHEXeXD4/QCCoTS+JBen8Yi8R6vxOkKHRyzBWCJCBIf9zmMNQV8EF IFLQjrNCPZtLqgUFj9iJgWHL50yXj/slLf89nh3VvWDpb8CQlu2xTIz0dUBbi7KoDYyb o62B9MlPthPCPh0F1wQwDOqAQL0GVghWqz9b2tRf1ZsUWBg4WCZvWc8uabw9WbTwnbLj yQHkxw4Maq67d6Zuu6aSBYFTXywDo2rVwAJOiPLzVA+etvTKirlfzBeQrWfBl5VjhU+y 185yIjyY/GxCKQLVCVJkJThOHhN6xwxK1eMYfdEx2nhbKOBEVCqRrXzMgg6jn5Ur5kX7 csLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796069786; x=1796674586; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3SxkjN7pJLG51kHGvwtC//rz3oh/sVmK9gm/E1cu04g=; b=xOCPJ3DZMgpiBlvWeGGUqwx1dI1ESDNxgYGv23DfdFifO6JbUkkKCYsnwL9aOk/wBt I3Rwjcu+niUGN9DhvMmpBwCnFqJ4ouhEtEA3uHquRvNNi2+5rSXMfb7rhF+8WwsnUGNd whfW84Gu/CJ9Wb19+IQwADp7EuiNqG18vggRtQ0ASaT+cPEBV50kzY4jOs9R7M7tt6We h+usxPGsR8WBCuqgK/Q67PEOrd+ao6RsfWo2r7QplSyWaOHQUcrkNx5poOEfXPaH1Ihy TUclXhArhHWDXT1dnFphz1Nhr/sunXsDd0NYuJhIJwiVO6akztU07CfVzakRd1OBmdX8 RgRw== X-Forwarded-Encrypted: i=1; AL+hErGabeBVRdu+m9n9EW8twrqcnOoLZR/Go/qbez68Iyagc65azmeatrahnFw3h9NBIHm9IwdYL1I8og==@nongnu.org X-Gm-Message-State: APuU4Z+Oe4fa6E8l+qxTZWUXro0ehZhm7pWitrEWPHYGeVpnXD0Gd/4c /4M7tvye62jrXm0m+FPX7yu6r9cw0uxnm8TE/H3qS/RgAnWE4/p1jnOBLTXz2UU6zts= X-Gm-Gg: AZFdTZeMUf5Qvqg/B2vRVdjTl4luR9+qGY+/p3N+TcykonI2s5CV2U3dKFtkDTcqgNN UZyWh+lR4f6lDCs4fs7yySWYfzKfBZAjpq3ZPJsfUNaIlVVg/YQekGqjj38KIgTD2p7OFaF0Kp0 db+cD63b9X2mIYMMTZWGtjQA+srQ2S2jkMNR5ytoY/4xHIBZXl5/6LwAp9lC5XVkkuImafyt7eJ ajlP7mV5gQhSH19YM4k/4xyE7YRl03oJZcJcoW6A+NUsxTDBhxHVvuTrJuHI/A982mUU83+v6kn UUIjn480v9+mt5zImmkteVeXA+w/Mb2mSuETYENWitIGlncDi3nOFtDOQKtU48K56FGq3k4c/Ku aBOYm4lTBEMBqjZ+jMoI+fpV/xB4xRzIxdkChLnRWXb2X6c86YegmLyRvFbOP4BOJipnrJvQLtj vGyNVksHDqPDVUwix4G4HB/kNWQ3wcajuleCQjbH8ywI4q/TJm/AmuWy7xTyel3e60GCLm0HZi6 qTfLiUuCXKKWNMLEgag2OF8RoaTOoY+Mz42j9PTel4roPgovVjLdkMvn3l216ppii3cTjEjGxUq O/5qQ03Dyi41LDuPGH5rLfDWDoU1EK01J0fQZBJHogXj3KCHkw== X-Received: by 2002:a05:600c:5306:b0:4bb:6ac0:6dc1 with SMTP id 5b1f17b1804b1-4bb887c994cmr660115315e9.2.1796069786123; Mon, 30 Nov 2026 12:16:26 -0800 (PST) Received: from draig.lan ([185.124.0.158]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbb39dd4e7sm278329275e9.0.2026.11.30.12.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 12:16:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8EAE15F9CE; Mon, 30 Nov 2026 20:16:23 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Yoshinori Sato , Liu Zhiwei , qemu-s390x@nongnu.org, Aleksandar Rikalo , David Hildenbrand , Laurent Vivier , Song Gao <17746591750@163.com>, Jiaxun Yang , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Xianglai Li , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, Daniel Henrique Barboza , qemu-ppc@nongnu.org, Brian Cain , Nicholas Piggin , Ilya Leoshkevich , Alistair Francis , Helge Deller , Weiwei Li , Richard Henderson , Aurelien Jarno , Chao Liu , Pierrick Bouvier , Palmer Dabbelt , Stafford Horne , Glenn Miles , Harsh Prateek Bora , Chinmay Rath , Paolo Bonzini , Bibo Mao Subject: [PATCH 2/4] scripts/tests: add regen-reference.sh Date: Mon, 30 Nov 2026 20:16:20 +0000 Message-ID: <20261130201623.159433-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130201623.159433-1-alex.bennee@linaro.org> References: <20261130201623.159433-1-alex.bennee@linaro.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 While we should verify references with real hardware we don't have hardware for all cases. Since the meson conversion we've made reference files mandatory so lets include a helper script to make things a bit easier to update. Signed-off-by: Alex Bennée --- scripts/tests/regen-reference.sh | 87 ++++++++++++++++++++++++++++++ tests/tcg/mips64/float_madds.ref | 64 ++++++++++++++++++++++ tests/tcg/mips64el/float_madds.ref | 64 ++++++++++++++++++++++ tests/tcg/mipsel/float_madds.ref | 64 ++++++++++++++++++++++ tests/tcg/or1k/float_madds.ref | 16 ++++++ tests/tcg/ppc64/float_madds.ref | 64 ++++++++++++++++++++++ tests/tcg/riscv64/float_madds.ref | 64 ++++++++++++++++++++++ 7 files changed, 423 insertions(+) create mode 100755 scripts/tests/regen-reference.sh diff --git a/scripts/tests/regen-reference.sh b/scripts/tests/regen-reference.sh new file mode 100755 index 00000000000..0600b56bef8 --- /dev/null +++ b/scripts/tests/regen-reference.sh @@ -0,0 +1,87 @@ +#!/bin/sh +# +# Regenerate TCG test reference files. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +set -eu + +usage() { + cat < + +Regenerate TCG reference (.ref) files for tests matching . +This script must be executed from inside a QEMU build directory using the './run' wrapper. + +Options: + -n Dry run (print commands without executing or overwriting files) + -h Show this help message +EOF + exit "${1:-1}" +} + +DRY_RUN=0 + +while getopts "nh" opt; do + case "$opt" in + n) DRY_RUN=1 ;; + h) usage 0 ;; + *) usage 1 ;; + esac +done +shift $((OPTIND - 1)) + +if [ $# -lt 1 ]; then + usage 1 +fi + +TEST_PATTERN="$1" + +# Must be run using the ./run wrapper which provides MESON_SOURCE_ROOT and MESON_BUILD_ROOT +if [ -z "${MESON_SOURCE_ROOT:-}" ] || [ -z "${MESON_BUILD_ROOT:-}" ]; then + echo "Error: MESON_SOURCE_ROOT or MESON_BUILD_ROOT is not set." >&2 + echo "This script must be executed from inside a build directory using the './run' wrapper, e.g.:" >&2 + echo " cd && ./run \$PWD/../scripts/tests/regen-reference.sh ${TEST_PATTERN}" >&2 + exit 1 +fi + +SRC_ROOT="$MESON_SOURCE_ROOT" +BUILD_DIR="$MESON_BUILD_ROOT" + +# Ensure we are inside the build directory +if [ ! -f "build.ninja" ] || [ "$(pwd -P)" != "$(cd "$BUILD_DIR" && pwd -P)" ]; then + echo "Error: This script must be executed from inside the build directory." >&2 + echo "Please cd into your build directory and run via './run'." >&2 + exit 1 +fi + +echo "!!! Warning: about to regenerate with TCG !!!" +echo "You should verify the real hardware generates the same reference files where you can" + +# Query meson test list +TEST_LIST=$(meson test --suite tcg --list "*${TEST_PATTERN}*" | grep -v "plugin") + +while IFS= read -r line; do + case "$line" in + *" / "*) + test_name="${line##* / }" + case "$test_name" in + *-linux-user-*) + arch="${test_name%%-linux-user-*}" + test_base="${test_name#*-linux-user-}" + + qemu_bin="./qemu-${arch}" + test_bin="tests/tcg/${test_name}.test" + ref_file="${SRC_ROOT}/tests/tcg/${arch}/${test_base}.ref" + + echo "${qemu_bin} ${test_bin} > ${ref_file}" + if [ "$DRY_RUN" -eq 0 ]; then + "${qemu_bin}" "${test_bin}" > "${ref_file}" + fi + ;; + esac + ;; + esac +done <