From patchwork Fri Aug 23 04:17:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Henrie X-Patchwork-Id: 1151932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-507568-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="fy5GYB0g"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vSn/I+0U"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46F7S30sx2z9sBp for ; Fri, 23 Aug 2019 14:18:26 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=fsX j2dB+g1+sAby896L2foP+JtxWrnCpB0dvTgDv6TE4WKm22NHN1/h5f4IdA6kzE03 mhbv1XgTwL2LNxHu944Mpgii/vQc6OUyd6XATHVhg7e6yzduQfRw5ZnmrRwZzGRR 98qK3itY2WMwscmPc9N2WOfzC0WymFfQ+MGP5BeQ= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=wUlKM9WN+ oCIRHaKhktJJKGEAb0=; b=fy5GYB0gkRsWQY4WjzyzSULRSugbSNDFqS1/vhJYa fOnbWqZAWCxsWsK57SiWrwp5vojFZw0kipgPK3faEUGhdkmnxaE9s9mI3/it9slt 7XPj6NxGYtKeCxeHOBiDL3uogH9dl9WEUQ3+Ur8LE+1ee7U9/BKqI8qozvulphjS w0= Received: (qmail 60467 invoked by alias); 23 Aug 2019 04:18:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 60365 invoked by uid 89); 23 Aug 2019 04:18:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.6 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: mail-io1-f45.google.com Received: from mail-io1-f45.google.com (HELO mail-io1-f45.google.com) (209.85.166.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 04:18:07 +0000 Received: by mail-io1-f45.google.com with SMTP id t6so17054046ios.7; Thu, 22 Aug 2019 21:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xkvHN3cy+2bc3lq43PlF3/eEloucFWjqkN6Teo3IXNw=; b=vSn/I+0UTiLH/lcbXlP1FpeXtaRIKWZ/OAOzw+RPr7stJ8ElXKqzKsH0/S1uO72+EC HO0+dM2VnCpCww9yvKYCbSVXDZ++RzcQrM59I3aidoHNGLDK4lO+T1kbG8Qhn0oQyWSl 1MvIe60k51eUHjPxqiEPnFg4cPawIPQX/1Q5tPVxYoZqbkxIS2oiDtdArvFVe3qbAVJf t1eLXZFu6AhtEUkWPZhVJows+V/Y00nosmS4V3RvSzl5nuYN+h5N1A1ecxIb2oH8mMNh F6V6Yt9vbKaB5+6giInDEWqHy9TOYHgN784gGln26vCsQABuCt8u5P34izYGR35A5yU9 eLwg== Received: from xavier.hsd1.ut.comcast.net ([2601:681:4100:375e:f2d5:bfff:fecd:8741]) by smtp.gmail.com with ESMTPSA id e17sm1124366ioh.0.2019.08.22.21.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 21:18:04 -0700 (PDT) From: Alex Henrie To: gcc-patches@gcc.gnu.org, manu@gcc.gnu.org, mliska@suse.cz, joseph@codesourcery.com, msebor@gmail.com, law@redhat.com Cc: Alex Henrie Subject: [PATCH resend 2/2] PR c/65403 - Add tests for -Wno-error= Date: Thu, 22 Aug 2019 22:17:40 -0600 Message-Id: <20190823041740.7186-2-alexhenrie24@gmail.com> In-Reply-To: <20190823041740.7186-1-alexhenrie24@gmail.com> References: <20190823041740.7186-1-alexhenrie24@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes * c-c++-common/pr65403-1.c: New test. * c-c++-common/pr65403-2.c: New test. --- gcc/testsuite/c-c++-common/pr65403-1.c | 10 ++++++++++ gcc/testsuite/c-c++-common/pr65403-2.c | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/c-c++-common/pr65403-1.c create mode 100644 gcc/testsuite/c-c++-common/pr65403-2.c diff --git a/gcc/testsuite/c-c++-common/pr65403-1.c b/gcc/testsuite/c-c++-common/pr65403-1.c new file mode 100644 index 00000000000..fbe004a1f78 --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr65403-1.c @@ -0,0 +1,10 @@ +/* PR c/65403 */ +/* Test an unrecognized -Wno-error option in the absence of any other + diagnostics. The -Wno-error option should be ignored. */ + +/* { dg-options "-Werror -Wno-error=some-future-warning" } */ + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/gcc/testsuite/c-c++-common/pr65403-2.c b/gcc/testsuite/c-c++-common/pr65403-2.c new file mode 100644 index 00000000000..8b5faa7270e --- /dev/null +++ b/gcc/testsuite/c-c++-common/pr65403-2.c @@ -0,0 +1,15 @@ +/* PR c/65403 */ +/* Test a warning, treated as an error, that some future -Wno-error option + might downgrade back to a warning. The -Wno-error option should produce a + warning in this case. */ + +/* { dg-options "-Wunused-variable -Werror -Wno-error=some-future-warning" } */ + +int main(int argc, char **argv) +{ + int foo; /* { dg-error "unused variable 'foo'" } */ + return 0; +} + +/* { dg-error "no option '-Wsome-future-warning'" "" { target *-*-* } 0 } */ +/* { dg-message "all warnings being treated as errors" "" { target *-*-* } 0 } */