From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id D39553858405 for ; Wed, 23 Feb 2022 13:48:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D39553858405 Received: by mail-pg1-x52d.google.com with SMTP id p23so19993781pgj.2 for ; Wed, 23 Feb 2022 05:48:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1pqIQWlj/BSxYk40b5Merzsmckc8co9HRmukf5oEpX8=; b=1oNRqJHW8DuXw0OmuBu7Phuwdt46Yp2aZfd9CEjKVbs8vd9r0t+BMjTRHzkFFTOwIT 8gDsDrOjL2wkq5KTIyRUVJ8OqD8WTGreuHXzIhySbJ4/Ge77FKxZTLI6kDU42huHhyVc vLsB2wyfG5bRAhuhsYHkIeOpC8kbNZsap+kKtnFYqZBn5wbziVcZrfpRYWFHQF8i7vqG kpe52qxr8PayE1VQSHsKLabK7W6MFsBo/gKkgVtaHvoPmJO1pRj8TX8sPI9aNQ9sRuzk eaaej+bxqM5om0RUUxH395jsIwqnkLLpEPMLA1rjuAml1A4IFY0YNBF6tVqwwUSDoTNF ecrg== X-Gm-Message-State: AOAM5305K+Im2e+DRRcE7bg3PRngpe6i6Ay6ziw92WmVnu5PmnlhS6cM MhtWxfoKznURDQbFjrzFNjVddOC60ML7CUTsJn0= X-Google-Smtp-Source: ABdhPJxuVnFQ9AYSCw92n6ey95JG7cw40/Y1M/Wfl35r3N/dJVJhSLUIbudO0XJQsKA6eN2frD19jFTVRKf9T88Mejw= X-Received: by 2002:a63:6ac7:0:b0:373:efe4:40f3 with SMTP id f190-20020a636ac7000000b00373efe440f3mr18322537pgc.313.1645624084853; Wed, 23 Feb 2022 05:48:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Krishna Narayanan Date: Wed, 23 Feb 2022 19:17:53 +0530 Message-ID: Subject: Re: Doubt regarding dg-directives To: Jonathan Wakely Cc: gcc-help , Segher Boessenkool X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2022 13:48:08 -0000 On Wed, Feb 23, 2022 at 1:46 PM Jonathan Wakely wrote: > > > On Wed, 23 Feb 2022 at 07:39, Krishna Narayanan < > krishnanarayanan132002@gmail.com> wrote: > >> >> >> On Tue, Feb 22, 2022 at 9:44 PM Jonathan Wakely >> wrote: >> >>> On Tue, 22 Feb 2022 at 15:38, Krishna Narayanan wrote: >>> >>>> Yes, it does. >>>> I used dg-warning and not dg warning (that was a sheer typing mistake). >>>> The warning is about the uninitialized variable being used in the >>>> testcase yet there is no warning on that line and the test results in >>>> FAIL. >>>> I used /* { dg-warning "uninitialized" } */ on that particular line.I >>>> used the test in gcc.dg, with other directive /* { dg-options "-O2" } >>>> */ . >>>> Can you help me where I went wrong? >>>> >>> >>> Don't you need -Wuninitialized in the dg-options as well? >>> >> > > > Yes I tried it with /* { dg-options "-O2 -Wuninitialized" } */ but still > it FAILs. > > Yes, but it fails differently now. You need to read the output more > carefully. Look at the gcc.log file, which shows you the full output. When > you enable warnings there are TWO warnings printed. You are only testing > for one. > > You can also compile the test by hand using the same options. What > happens? You get TWO warnings. You only tested for one. So it's going to > FAIL. > > The log file should show something like this: > > PASS: test.c (test for warnings, line 10) > FAIL: test.c (test for excess errors) > Excess errors: > test.c:6: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized] > > That means it matched the dg-warning on line 10, but there was also > another warning on line 6, which dejagnu thinks was unexpected (because you > didn't tell it to expect it or to ignore it). That makes the test fail. > >> Yes understood,all tests have been PASSed,hopefully I should submit a >> patch(testcase) for the bug,just getting it regtested. >> > Thanks a lot, >> > Krishna Narayanan >> > > >