From patchwork Tue Dec 10 14:23:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederik Harwath X-Patchwork-Id: 1207114 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515607-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="BMR1DI1I"; 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 47XMkV5bv8z9sRH for ; Wed, 11 Dec 2019 01:24:02 +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:from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=a8c082R1+3z6nO4v ZjftyxUNEK+KCRQy0HeaTeb3zCmCvTXa67I+6CYtW/L3YDnU2QN4hSpNzxCJWYXU /J10cexOjIlu3MdR9QL9oxWaZp97HJMskuURHLFxKoZKRS5idmN14zwv8BoIxlUX wcswmPkfyVE6GyxA0YqBYtruzd4= 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-type; s=default; bh=08prgPYLUGeAbw1Ex4YoIY xEdB0=; b=BMR1DI1ISawpGpYjkX0oqVRIMFDmgMLbrxjIUkx+WV83fY4ngCP6PI GxHCvspnx75rqHm1R8T+ue4XQW3SAp6sxiFnTjmp6tJ/R8eHo1ALAsFoYaWWlZ6d XfFzIk+i/cpij46uEbsW9hMlqfu5YlGxZExl7R0HIsDWuzHtzwNLE= Received: (qmail 81504 invoked by alias); 10 Dec 2019 14:23:39 -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 81443 invoked by uid 89); 10 Dec 2019 14:23:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=communicated X-HELO: esa1.mentor.iphmx.com Received: from esa1.mentor.iphmx.com (HELO esa1.mentor.iphmx.com) (68.232.129.153) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 14:23:37 +0000 IronPort-SDR: UQ7sh1QkxB4FraFyKUlYwYEPfu6VjEzLCF0g1B8Glx4qyKwGuho73VrBTQtfmI9jPU0yWd41r7 04PB+Iss89WLo+ll5/xCVCnavpsJWKejPq5JxlA4DUQK73xTJxohcD544ae7EahHrZbqWrxWGZ C77J/nfvikWAOoPsnJ0m2clpNXkC7ohAy4xTirKXmoGr6hjLCLaBQv+6kD7PwX6FK2wAH50wbx Nb/jqAhS7qt3u9qP5uuG5jCDRHEx9Kr+8D/etwhAjnEGNW3TOHUF46MOlyQkLtc3FXRqChZKQN /U4= Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 10 Dec 2019 06:23:37 -0800 IronPort-SDR: QDVKUhj7JIN6nOJ02bHPYrxAx13WDC4keQyQyAbg7hRERmGEcxXWB8W6wHm2fWcDjLBeHZMsjx Y2u+IIgZgaOo7SI+WN3yJBt7y4iN6aoVymC/sSU8z9uQS7crBKHGAp3k+WfYE/G51BvNpHwJN9 /wWuELMl7a6YhMPZ9iew1Nfh3CIzNIDDXoRGWRjkApxrIxQYX6TqkUFQAOkgOeTmDnGS8fcjMV 4oZcJAC+rrxVVE9fFiKJSzUmZAflvp7s5ORp4b1X6rlwqhExA2E6bB/e0TeilkVvdB5KmX/Sd7 fiM= From: Frederik Harwath To: , , CC: Subject: [PATCH 2/2] Add tests to verify OpenACC clause locations Date: Tue, 10 Dec 2019 15:23:03 +0100 Message-ID: <20191210142303.9948-3-frederik@codesourcery.com> In-Reply-To: <0624ce85-2ee7-38eb-d115-509d600d3f20@codesourcery.com> References: <0624ce85-2ee7-38eb-d115-509d600d3f20@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes Check that the column information for OpenACC clauses is communicated correctly to the middle-end, in particular by the Fortran front-end (cf. PR 92793). 2019-12-10 Frederik Harwath gcc/testsuite/ * gcc.dg/goacc/clause-locations.c: New test. * gfortran.dg/goacc/clause-locations.f90: New test. --- gcc/testsuite/gcc.dg/goacc/clause-locations.c | 17 +++++++++++++++++ .../gfortran.dg/goacc/clause-locations.f90 | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/goacc/clause-locations.c create mode 100644 gcc/testsuite/gfortran.dg/goacc/clause-locations.f90 diff --git a/gcc/testsuite/gcc.dg/goacc/clause-locations.c b/gcc/testsuite/gcc.dg/goacc/clause-locations.c new file mode 100644 index 00000000000..51184e3517b --- /dev/null +++ b/gcc/testsuite/gcc.dg/goacc/clause-locations.c @@ -0,0 +1,17 @@ +/* Verify that the location information for clauses is correct. */ + +void +check_clause_columns() { + int i, j, sum, diff; + + #pragma acc parallel + { + #pragma acc loop reduction(+:sum) + for (i = 1; i <= 10; i++) + { + #pragma acc loop reduction(-:diff) reduction(-:sum) /* { dg-warning "53: conflicting reduction operations for .sum." } */ + for (j = 1; j <= 10; j++) + sum = 1; + } + } +} diff --git a/gcc/testsuite/gfortran.dg/goacc/clause-locations.f90 b/gcc/testsuite/gfortran.dg/goacc/clause-locations.f90 new file mode 100644 index 00000000000..29798d31542 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/clause-locations.f90 @@ -0,0 +1,18 @@ +! Verify that the location information for clauses is correct. +! See also PR 92793. + +subroutine check_clause_columns () + implicit none (type, external) + integer :: i, j, sum, diff + + !$acc parallel + !$acc loop reduction(+:sum) + do i = 1, 10 + !$acc loop reduction(-:diff) reduction(-:sum) ! { dg-warning "47: conflicting reduction operations for .sum." } + do j = 1, 10 + sum = 1 + end do + end do + !$acc end parallel +end subroutine check_clause_columns +