From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119668 invoked by alias); 1 Jun 2016 20:30:31 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 119659 invoked by uid 89); 1 Jun 2016 20:30:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=num_gangs 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 01 Jun 2016 20:30:20 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1b8CmP-0002QQ-GL from Cesar_Philippidis@mentor.com for gcc-patches@gcc.gnu.org; Wed, 01 Jun 2016 13:30:17 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Wed, 1 Jun 2016 13:30:17 -0700 To: "gcc-patches@gcc.gnu.org" From: Cesar Philippidis Subject: [PATCH] add a test case for PR70688 Message-ID: <574F45D8.8030609@codesourcery.com> Date: Wed, 01 Jun 2016 20:30:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010006010603080102080400" X-SW-Source: 2016-06/txt/msg00080.txt.bz2 --------------010006010603080102080400 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-length: 263 I had already fixed pr70688 in trunk r236678 with the patch I introduced here . This patch introduces a new libgomp test case to verify the fix. I'll apply this patch to trunk and gomp4 as obvious. Cesar --------------010006010603080102080400 Content-Type: text/x-patch; name="pr70688.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pr70688.diff" Content-length: 739 2016-06-01 Cesar Philippidis libgomp/ PR c/70688 * pr70688.c: New file. diff --git a/pr70688.c b/pr70688.c new file mode 100644 index 0000000..9d80577 --- /dev/null +++ b/pr70688.c @@ -0,0 +1,27 @@ +/* Verify that reduction variables can appear in data clause. */ + +#include + +const int n = 100; + +int +main () +{ + int s = 0; + int array[n]; + + for (int i = 0; i < n; i++) + array[i] = i+1; + +#pragma acc parallel loop num_gangs (10) copy (s) reduction (+:s) + for (int i = 0; i < n; i++) + s += array[i]; + +#pragma acc parallel loop num_gangs (10) reduction (+:s) copy (s) + for (int i = 0; i < n; i++) + s += array[i]; + + assert (s == n * (n + 1)); + + return 0; +} --------------010006010603080102080400--