From patchwork Wed Jul 31 16:39:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitar Dimitrov X-Patchwork-Id: 1967201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dinux.eu header.i=@dinux.eu header.a=rsa-sha256 header.s=default header.b=Bonl8ja1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYyWT4BXrz1ybb for ; Thu, 1 Aug 2024 02:40:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C529B385B50B for ; Wed, 31 Jul 2024 16:40:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from server28.superhosting.bg (server28.superhosting.bg [217.174.156.11]) by sourceware.org (Postfix) with ESMTPS id C54953858C78 for ; Wed, 31 Jul 2024 16:39:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C54953858C78 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=dinux.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=dinux.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C54953858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.174.156.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722444000; cv=none; b=gzFuqrLLYAchkgVlMa+ze++M2kbxLKLGScaM4UQqKTUnXFhW2GB1FBj88pGAADXOqfpO0hhxXCDwO1+FRHE1xXNr8BsuMLFQC749lv2qj8xeymfM7iXE0LP1MWqQaij3FjXTFrLbV4lC1li2jJWsY+NzDy9P5vLZeaxp4rPI2q4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722444000; c=relaxed/simple; bh=9SLVt5M2bSqH5/SuheylRmrD+oAlA+/EPb9z7++WpXk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fzKy/zZqjWWagUFUE+t/6RsjlIPerMuY4+L8b7SY7AQNXuBbiq1dfZhLwomiZcFfQGpRtcjTlcD6Xi5UAu0WDvaZjvGdAYYHJVN7n3kO/kBIxGgpYvSo6g7fyshUf8GnEQKUuGmB0cUd1mm0wAol21M1uffjFrntWO1L850Trno= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=v7a5qNFLA9Y9L6eCGIfzj/Nj5hALQ4EVO5s5IS51nYY=; b=Bonl8ja1bh6vvlIvQ4WXSO0jn2 pcIlZfBdqVUAzI8mwx5Y9e4Tc/cqi18SwRG3VlDkDYPgQTl49f+V+O1e+oJzmhFfOTX0jgOCP+RfJ 6X6Ik/uXmNN7iVX+M1vbqVrlOU9FOVoEn+etkQ+GeIg8tITCZ5krZEvbITQwwQvJiwP/px/pVqV3g Je0BpgPhl3PxdsdQAYBiYasvBHvi/qVWBro/baajA+hb94Gv+Jq1nFbSYatpWkodBA0VwdA1OymyL cNYSDOmqunvQuxUpYKoBgjomWB+WlsqL9JJPcBsdCGshfa6+KnRWgA2XiFppKTYd1X6VdbXdezjRk Ull92ong==; Received: from 95-42-20-142.ip.btc-net.bg ([95.42.20.142]:40922 helo=kendros.lan) by server28.superhosting.bg with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1sZCMj-0008Wa-31; Wed, 31 Jul 2024 19:39:55 +0300 From: Dimitar Dimitrov To: gcc-patches@gcc.gnu.org Cc: Dimitar Dimitrov Subject: [committed] testsuite: Fix for targets not passing argc/argv [PR116154] Date: Wed, 31 Jul 2024 19:39:39 +0300 Message-ID: <20240731163940.426064-1-dimitar@dinux.eu> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server28.superhosting.bg X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dinux.eu X-Get-Message-Sender-Via: server28.superhosting.bg: authenticated_id: dimitar@dinux.eu X-Authenticated-Sender: server28.superhosting.bg: dimitar@dinux.eu X-Source: X-Source-Args: X-Source-Dir: X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org PRU and other simulator targets do not pass any argv arguments to main. Instead of erroneously relying on argc==0, use a volatile variable instead. I reverted the fix for PR67947 in r6-3891-g8a18fcf4aa1d5c, and made sure that the updated test case still fails for x86_64: $ make check-gcc-c RUNTESTFLAGS="dg-torture.exp=pr67947.c" ... FAIL: gcc.dg/torture/pr67947.c -O1 execution test ... # of expected passes 8 # of unexpected failures 8 Fix was suggested by Andrew Pinski in PR116154. Committed as obvious. PR testsuite/116154 gcc/testsuite/ChangeLog: * gcc.dg/torture/pr67947.c: Use volatile variable instead of argc. Signed-off-by: Dimitar Dimitrov --- gcc/testsuite/gcc.dg/torture/pr67947.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/torture/pr67947.c b/gcc/testsuite/gcc.dg/torture/pr67947.c index 368a8b20cbf..1016f2579cb 100644 --- a/gcc/testsuite/gcc.dg/torture/pr67947.c +++ b/gcc/testsuite/gcc.dg/torture/pr67947.c @@ -11,11 +11,13 @@ __attribute__((noinline, noclone)) void foo (int x) c++; } +volatile int t = 1; + int main (int argc, char* argv[]) { int j, k, b = 0; - if (argc == 0) + if (t == 0) b = 1; for (j = 0; j < 3; j++) for (k = 0; k < 1; k++)