From patchwork Wed Dec 27 07:31:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 853076 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-469830-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="aWWESKqW"; 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 3z64LQ34gPz9sxR for ; Wed, 27 Dec 2017 18:32:10 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=uN0luJX4XRxy+nNtg ndlDySDpjKp0q32hiPy6g0m2zz2z2Tkd3kkgAleFUzlFsx7EFDD91nl6Idhz8L/i T0bsT0lL3H8B58YrlGQAQ0eJ/ZUk3TQClvfLOIdxaGuxu1VI2SG+pajaoh4Ue+LR YJf4n9WZeeXZbrw2T5apPlDQe4= 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=f54zxtHqghyehbc2c/8zZgJ 4jaY=; b=aWWESKqWFiA0qQq2yzipFP6t4jh8PAFb3gbeQmNNjH2uuSHQLycuogh RK4cGjf3HulBGSCeyBStwQvLXuCXKW9ezdKWs/rhEPbN4jbCVN5RGWCMrNukafl5 DbVZCT8TN5f+YLDlFrFxjiH0oiCjskJ3hVSRliuokjLr6b2mrgNE= Received: (qmail 105705 invoked by alias); 27 Dec 2017 07:32:01 -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 105683 invoked by uid 89); 27 Dec 2017 07:32:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Dec 2017 07:31:59 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1eU6Bu-0005Mb-VH from Tom_deVries@mentor.com ; Tue, 26 Dec 2017 23:31:54 -0800 Received: from [172.30.72.108] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 27 Dec 2017 07:31:50 +0000 Subject: [testsuite, committed] Use relative line number in unroll-5.c To: Eric Botcazou , CC: Joseph Myers , Jason Merrill References: <1908294.BNiOnM3a76@polaris> From: Tom de Vries Message-ID: Date: Wed, 27 Dec 2017 08:31:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1908294.BNiOnM3a76@polaris> X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) [ was: Re: [C/C++] Add support for #pragma GCC unroll v3 ] On 11/25/2017 11:15 AM, Eric Botcazou wrote: > Index: testsuite/c-c++-common/unroll-5.c > =================================================================== > --- testsuite/c-c++-common/unroll-5.c (revision 0) > +++ testsuite/c-c++-common/unroll-5.c (working copy) > @@ -0,0 +1,29 @@ > +/* { dg-do compile } */ > + > +extern void bar (int); > + > +int j; > + > +void test (void) > +{ > + #pragma GCC unroll 4+4 > + for (unsigned long i = 1; i <= 8; ++i) > + bar(i); > + > + #pragma GCC unroll -1 /* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */ > + for (unsigned long i = 1; i <= 8; ++i) > + bar(i); > + > + #pragma GCC unroll 20000000000 /* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */ > + for (unsigned long i = 1; i <= 8; ++i) > + bar(i); > + > + #pragma GCC unroll j /* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */ > + /* { dg-error "cannot appear in a constant-expression|is not usable in a constant expression" "" { target c++ } 21 } */ > + for (unsigned long i = 1; i <= 8; ++i) > + bar(i); > + > + #pragma GCC unroll 4.2 /* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than or equal to" } */ > + for (unsigned long i = 1; i <= 8; ++i) > + bar(i); > +} Hi, this patch changes the absolute line number into a relative one. Tested on x86_64 and committed. Thanks, - Tom Use relative line number in unroll-5.c 2017-12-26 Tom de Vries * c-c++-common/unroll-5.c: Use relative line number. --- gcc/testsuite/c-c++-common/unroll-5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/c-c++-common/unroll-5.c b/gcc/testsuite/c-c++-common/unroll-5.c index 754f3b1..b728066 100644 --- a/gcc/testsuite/c-c++-common/unroll-5.c +++ b/gcc/testsuite/c-c++-common/unroll-5.c @@ -19,7 +19,7 @@ void test (void) bar(i); #pragma GCC unroll j /* { dg-error "requires an assignment-expression that evaluates to a non-negative integral constant less than" } */ - /* { dg-error "cannot appear in a constant-expression|is not usable in a constant expression" "" { target c++ } 21 } */ + /* { dg-error "cannot appear in a constant-expression|is not usable in a constant expression" "" { target c++ } .-1 } */ for (unsigned long i = 1; i <= 8; ++i) bar(i);