From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id ECE213858D1E for ; Mon, 30 Jan 2023 21:13:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECE213858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x635.google.com with SMTP id k13so13073194plg.0 for ; Mon, 30 Jan 2023 13:13:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zU54YcYfiN9VjXxOQZuuHIWhPtSxLk0G/2EqUQ3XHPw=; b=YJJ84bPdUrXNQKPBWFZmxe9Ah9oJkl6Ci+QsZT1abz2nHslDZSBsJrRoJ9znw2HZop ycGic2YtOS1Xy7/0P1AXJNhonjmw6G0X7ljeKk4pNS2GnOSu4Dq4Kyw6aO6Zrqo/gRbp C8u5cWKEJjc934yoofyY3i3FEXC+J4sUkkP1pXAeq32CHG8/OOwLuJYwyYI04rx5WgUE IppnNlOdcFhsleOjCl/nwNFPOxS9QzZcFBejP4OmlZvgugye6/uOmq+ldWFzscXiO0h/ 1/5NvyCnxpjSo/Y1mO9Y2/cpi980vl9sZWIvUy72zUGxywSG6BUZ/xNeTjWvXS5hmpJ1 GN3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zU54YcYfiN9VjXxOQZuuHIWhPtSxLk0G/2EqUQ3XHPw=; b=kZkP+IlohLaarPrVW1xnvinNAR2QdyuRHoAZmhg+lIE7rppnbu/1Yn43r0GfOTIFhu vJE8YRqpXG+suGGo7RdPS4+dStq+FhrzEKy2Y4GBGoszAwNaE1fhertzViDuMptHi8fD c97aa3wZhehNy7pDe3HvsOXcGrgj+OwEzW0wh54c1aUwB4azELLPNgknbEucT6jDSbdF XtZAOZvJYihdttGXhJ6j3o5GulPTBPnr6w2e0xeCHb4bmR2bFKsWoAZUqqVgXaQaCUT+ Eek7CgGAqH2HGqGQpuXrTwPA4mI49rOPmjDNcOXLOifPdtFa+3s8o6uOl5lwIqDhyuaG loCg== X-Gm-Message-State: AO0yUKV2ZPR1kUZ38G8QtCP0HK5sXRy0IsTxyUJQXWmt3LW3p7x4ECRF jsIgE5IDZFjRxztxORJjMdIcYAMEUtZ6bu2ugfE= X-Google-Smtp-Source: AK7set8nnaRwYk4hS+Iw3//cEeTQ9l4Zq0r6Wkgli9ulGyFkyqTUbEnZfSD7zuT/PCMdP7QS3wnsxbIMoOmf0CNSiV8= X-Received: by 2002:a17:90a:2dc1:b0:22c:6ad:5def with SMTP id q1-20020a17090a2dc100b0022c06ad5defmr3110135pjm.178.1675113226655; Mon, 30 Jan 2023 13:13:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Pinski Date: Mon, 30 Jan 2023 13:13:34 -0800 Message-ID: Subject: Re: Testsuite, dejagnu To: Harald Anlauf Cc: fortran Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 server2.sourceware.org List-Id: On Mon, Jan 30, 2023 at 12:27 PM Harald Anlauf via Fortran wrote: > > Dear Hackers, > > is there a way to check that a particular warning is emitted only > once for a source code line instead of multiple times? > > It appears that by default dg-warn matches one or more times. One example of how to do this is located in testsuite/g++.dg/lookup/duperr1.C . I don't know if this is the best way of doing it though. Basically it uses dg-bogus to match the multiple warnings (since it is a regex over all output lines and `.*` will even match new lines) so you get a failure if there was a duplicated one and then dg-message to match the original message just to make sure it is outputted once (dg-message was because it was originally a note: rather than a warning/error but similar thing can be done for dg-error/dg-warning). Thanks, Andrew Pinski > > Thanks, > Harald >