From patchwork Thu Mar 24 16:24:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 601679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3qWBcJ2cmtz9sD5 for ; Fri, 25 Mar 2016 03:25:20 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=vFtyfRWP; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=a9J95u24WS7ruWgrAsC+GvElq77y6o42OAZftpFf/7tk8/w7oY p02Ni/2dgXB/eypY4bgyWXSD2q/O2xaWXtPUUlAygk1dOp/iFh50xJWlQ/eD6gKw 0+1iw1a594l9lUgO3n3EpIyWMRXJOBBwKnZ3/j0eQO8RXafLMb4ZEeKZM= 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:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=ZjntpxJediE5X7vN6GXTVXe3DzQ=; b=vFtyfRWPxLID8gPx2CoS sIPLwk9VnsiiZyofcodJeWRi9Aeg0kTxbZjzr2vqNWesJhpMOvXx/EThX+PkAmFn gCnf1iHMq5zPwq8aSagOIXSYveGqYZlrEHY8rwfEk4tdorMTMRo3bdq8B6O9lnBX otF6Y/hS6SyhJ8I+tiDjhXY= Received: (qmail 66177 invoked by alias); 24 Mar 2016 16:24:56 -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 66057 invoked by uid 89); 24 Mar 2016 16:24:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 24 Mar 2016 16:24:44 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aj83s-0000My-Ri from Tom_deVries@mentor.com for gcc-patches@gcc.gnu.org; Thu, 24 Mar 2016 09:24:41 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Thu, 24 Mar 2016 16:24:39 +0000 To: GCC Patches CC: Thomas Schwinge From: Tom de Vries Subject: [testsuite, committed] Add goacc/uninit-dim-clause.{c,f95} Message-ID: <56F414C0.2020609@mentor.com> Date: Thu, 24 Mar 2016 17:24:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Hi, I've committed attached patch, which adds testcases that test the -Wuninitialized warning for the num_gangs, num_workers, vector_length clauses on the openacc directive parallel. Thanks, - Tom Add goacc/uninit-dim-clause.{c,f95} 2016-03-24 Tom de Vries * c-c++-common/goacc/uninit-dim-clause.c: New test. * gfortran.dg/goacc/uninit-dim-clause.f95: New test. --- gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c | 19 +++++++++++++++++++ gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95 | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c new file mode 100644 index 0000000..0a006e3 --- /dev/null +++ b/gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-Wuninitialized" } */ + +#include + +int +main (void) +{ + int i, j, k; + + #pragma acc parallel num_gangs(i) /* { dg-warning "is used uninitialized in this function" } */ + ; + + #pragma acc parallel num_workers(j) /* { dg-warning "is used uninitialized in this function" } */ + ; + + #pragma acc parallel vector_length(k) /* { dg-warning "is used uninitialized in this function" } */ + ; +} diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95 new file mode 100644 index 0000000..b87d26f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95 @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-additional-options "-Wuninitialized" } + +program test + implicit none + integer :: i, j, k + + !$acc parallel num_gangs(i) ! { dg-warning "is used uninitialized in this function" } + !$acc end parallel + + !$acc parallel num_workers(j) ! { dg-warning "is used uninitialized in this function" } + !$acc end parallel + + !$acc parallel vector_length(k) ! { dg-warning "is used uninitialized in this function" } + !$acc end parallel + +end program test