From patchwork Mon Apr 6 12:26:26 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 132723 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id A1CBE4BA23E1 for ; Mon, 6 Apr 2026 12:27:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A1CBE4BA23E1 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=cebitec.uni-bielefeld.de header.i=@cebitec.uni-bielefeld.de header.a=rsa-sha256 header.s=20200306 header.b=S6gKgs2i X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 2085B4BA2E21; Mon, 6 Apr 2026 12:26:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2085B4BA2E21 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2085B4BA2E21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775478389; cv=none; b=cFlUjC/7M0dgVSUzMU/S9rL0TuowvHqIIRrUjYiJ/W2e59LhGq9FcQDinbAklcEQ2ObSiTzQDkkgTH7HmEzFRDUshFJbkvG44BaHavcnF9xN3zqrDS9ZCvE1oh3I5tNkXCuVqgGFFznSffKqic13TYfoY1siRTsZ97VV+Cyh8UA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775478389; c=relaxed/simple; bh=EgxXHRTtuyOglz9LVplq1qg5b8aDAHIlBA1Zw6s/oXo=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HbRsl1xCzyfal/COret2crQQTPfhVDS2YReOCD3yS5BDrFZmpQcL1NampHMZqpXtY1FSsNqFy2a/AvdIbFWC3HHvCrDd4SuU+b19cx1PGZV3t/n14CIypb033yIsS0LO+a/F7M5GA8pRmOWYk6XEE+IHYiIE328n17s7UDC7A2Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2085B4BA2E21 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id E9B3AE99FB; Mon, 6 Apr 2026 14:26:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1775478387; bh=EgxXH RTtuyOglz9LVplq1qg5b8aDAHIlBA1Zw6s/oXo=; b=S6gKgs2iRGYoy3CF9H3qy QR5sE4k+MJRjcZYKAlpGYQBFoZB/N3QUS40PkbE44LGAQcvDsvi8/8ozAdmGFInX dMoxzY0i4E2PKUVQo0dyzI2dNhUM2JKLPxmzhIuZUzGFa0I7VTflsBmsGZB52Pc7 cCRBNp7vvvtaGC2XkqpISoPEC7CQ3vyWZzooOeGMdys2BiSRF9JEBsmVd/wiwLW2 iIjYCWxPIBfuDF6OvzGjtYKvfVHZ9XDWCwoClvhwxbfSIvRWJqBUK2rlhENazG4N VATaYUVbyN0P07dFZHNbAVrwkSy1PfEvPYOMBMRnZjQ1ftN+iJ84A6Tc/TXB7jRD Q== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id egr3bzmABXYV; Mon, 6 Apr 2026 14:26:27 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4fddbd93.dip0.t-ipconnect.de [79.221.189.147]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 84E89E9AFA; Mon, 6 Apr 2026 14:26:27 +0200 (CEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Alexandre Oliva , Mike Stump Subject: [COMMITTED] testsuite: Fix dg-do-if Date: Mon, 06 Apr 2026 14:26:26 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-3780.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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~patchwork=sourceware.org@gcc.gnu.org Tests that use dg-do-if ERROR when the target selector matches, e.g. ERROR: gcc.dg/vect/vect-simd-clone-16f.c -flto -ffat-lto-objects: compile: syntax error for " dg-do-if 1 compile { target { sse2_runtime && { ! sse4_runtime } } } " While the error message isn't particularly helpful, it's from dg.exp (dg-do): like the other dg-* procs it expects the line number to be the first argument. However, dg-do-if strips that, so dg-do gets the target selector instead of the expected action keyword. Fixed by no longer stripping the line number. Tested on amd64-pc-freebsd15.0 (sse2_runtime && !sse4_runtime), i386-pc-solaris2.11 and x86_64-pc-linux-gnu (sse2_runtime && sse4_runtime). Committed to trunk. I cannot help thinking that dg-do-if is overkill: it's only used in 4 test cases and never actually worked. Rainer # HG changeset patch # Parent eda78d3442ceaf2f46fa3d600b731501478cb561 testsuite: Fix dg-do-if diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -422,9 +422,8 @@ proc check-flags { args } { # (possibly the default) prevails. proc dg-do-if { args } { - set args [lreplace $args 0 0] # Verify the number of arguments. - if { [llength $args] != 2 } { + if { [llength $args] != 3 } { error "syntax error, need a single action and target selector" } @@ -435,7 +434,7 @@ proc dg-do-if { args } { } # Evaluate selector, return if it does not match. - switch [dg-process-target-1 [lindex $args 1]] { + switch [dg-process-target-1 [lindex $args 2]] { "N" { return } "P" { return } }