From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OKglE07fCmKragAAWB0awg (envelope-from ) for ; Mon, 14 Feb 2022 18:01:34 -0500 Received: by simark.ca (Postfix, from userid 112) id 49CBF1F3C5; Mon, 14 Feb 2022 18:01:34 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 937B41EA69 for ; Mon, 14 Feb 2022 18:01:33 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 19A053858424 for ; Mon, 14 Feb 2022 23:01:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 19A053858424 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644879693; bh=OYS6Qvnmfo3sDq/FywtGg+jjLn8amOnpX4YzAOVZ0UI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bdcQBNbxZqslAeknnOCqC/99ip2TOUNAxeCxUZCbbs2Tjg03g8FhpKFAAG5Lt03kC 3KRK2QYsIDc2cepwczVXotIozrbEGNkyikF8RrduuA2AlLT4RjFo4aPMXf1wq+n+XB A9Yi0CrtZkCLRxe1gYsOf2zabmWHHYNhRNzfwYMQ= Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id E01D03858D3C for ; Mon, 14 Feb 2022 23:01:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E01D03858D3C To: Subject: [PATCH 02/12] sim/testsuite/cris: Assembler testcase for PRIx32 usage bug MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20220214230113.BA08A20439@pchp3.se.axis.com> Date: Tue, 15 Feb 2022 00:01:13 +0100 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Hans-Peter Nilsson via Gdb-patches Reply-To: Hans-Peter Nilsson Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Several C test-cases exposed the bug, but let's have one for people who test using just the assembler and linker. * asm/endmem1.ms: New test. --- sim/testsuite/cris/asm/endmem1.ms | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sim/testsuite/cris/asm/endmem1.ms diff --git a/sim/testsuite/cris/asm/endmem1.ms b/sim/testsuite/cris/asm/endmem1.ms new file mode 100644 index 000000000000..ff9e334c38a9 --- /dev/null +++ b/sim/testsuite/cris/asm/endmem1.ms @@ -0,0 +1,47 @@ +# mach: crisv3 crisv8 crisv10 crisv32 + +; Check that the simulator and the program agrees on the +; value of endmem; the base point for further allocations. + + .include "testutils.inc" + start + +; First, get the end of memory by calling brk with 0 to get +; the current value. + clear.d $r10 + movu.w 0x2d,$r9 + break 13 + +; Get one more 8192-byte page. + addu.w 8192,$r10 + +; Save it in a (call- and) syscall-saved register. + move.d $r10,$r0 + +; Call brk again to raise the value. + movu.w 0x2d,$r9 + break 13 + +; If the simulator messed up internally, it'd have exited +; with an error at the brk call. But, let's sanity-check +; the return-value: it should be the same as the input and +; the allocated memory should be accessible. + cmp.d $r10,$r0 + beq 0f + nop + +1: + fail + +0: +; Check that we can write and read the last address on that +; page. + subq 4,$r10 + move.d 0xbad1d101,$r12 + move.d $r12,[$r10] + move.d [$r10],$r11 + cmp.d $r11,$r12 + bne 1b + nop + + pass -- 2.30.2