From patchwork Tue Jul 12 13:50:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 647400 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 3rpjz80XKsz9s3v for ; Tue, 12 Jul 2016 23:50:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=QsFbDH9I; 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=J1MotKLD0WOimP7w xJQYsJxTh8Pz1deaaJCgBH8NsW5DuKjy6ljaP+MHj0WQMWH3vq9rmgrgblXMmfSk ssmBwIjT0juk4DFXouPym96aiUC2wzx0P26FuMfOlZSNOumXXY18CshKL5Oi9Cjh pT2peBs1AzSACqJklJ2ZEt7uNcw= 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=FYtYmwBBTraGALSiFbwK+u 9U/cs=; b=QsFbDH9IPrDui+fJSFerIlPYTcH2PYsBzNuu4NnCszZFJAbwoRJ6ML TyzlkwEsqgiDbVkGLx7vOTRwEbsmUvJsS5to/fV7jAi8HL2eewQN5iw14NVjl/fP ZpLQaJpwufTrFcc7bkLnoJypOY86DQVutxRtO99134R46I4+arDGc= Received: (qmail 63730 invoked by alias); 12 Jul 2016 13:50:34 -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 63721 invoked by uid 89); 12 Jul 2016 13:50:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=gr 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; Tue, 12 Jul 2016 13:50:23 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1bMy4q-0004ln-DO from Thomas_Schwinge@mentor.com ; Tue, 12 Jul 2016 06:50:20 -0700 Received: from hertz.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.224.2; Tue, 12 Jul 2016 14:50:19 +0100 From: Thomas Schwinge To: Jakub Jelinek , Subject: C++ OpenACC routine directive testing: templated, and "auto", trailing return type syntax User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Tue, 12 Jul 2016 15:50:14 +0200 Message-ID: <87vb0bm0dl.fsf@hertz.schwinge.homeip.net> MIME-Version: 1.0 Hi! Templated, and "auto", trailing return type syntax with the C++ OpenACC routine directive all works, but doesn't have test coverage. OK for trunk? commit 7a387329674b07b8eb7e07cff665250284b4524b Author: Thomas Schwinge Date: Thu Jul 7 16:12:15 2016 +0200 C++ OpenACC routine directive testing: templated, and "auto", trailing return type syntax libgomp/ * testsuite/libgomp.oacc-c++/routine-1-auto.C: New file. * testsuite/libgomp.oacc-c++/routine-1-template-auto.C: Likewise. * testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C: Likewise. * testsuite/libgomp.oacc-c++/routine-1-template.C: Likewise. * testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C: Likewise. * testsuite/libgomp.oacc-c-c++-common/routine-1.c: Adjust. --- libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C | 9 +++++++++ libgomp/testsuite/libgomp.oacc-c++/routine-1-template-auto.C | 8 ++++++++ .../routine-1-template-trailing-return-type.C | 8 ++++++++ libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C | 8 ++++++++ .../libgomp.oacc-c++/routine-1-trailing-return-type.C | 9 +++++++++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c | 12 ++++++++++-- 6 files changed, 52 insertions(+), 2 deletions(-) Grüße Thomas diff --git libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C new file mode 100644 index 0000000..f4b54e5 --- /dev/null +++ libgomp/testsuite/libgomp.oacc-c++/routine-1-auto.C @@ -0,0 +1,9 @@ +// Routine with "auto" return type. + +// { dg-additional-options "-fno-exceptions" } + +#define TEMPLATE +#define TYPE int +#define RETURN_1 auto +#define RETURN_2 +#include "../libgomp.oacc-c-c++-common/routine-1.c" diff --git libgomp/testsuite/libgomp.oacc-c++/routine-1-template-auto.C libgomp/testsuite/libgomp.oacc-c++/routine-1-template-auto.C new file mode 100644 index 0000000..444f1f3 --- /dev/null +++ libgomp/testsuite/libgomp.oacc-c++/routine-1-template-auto.C @@ -0,0 +1,8 @@ +// Templated routine with "auto" return type. + +// { dg-additional-options "-fno-exceptions" } + +#define TEMPLATE template +#define RETURN_1 auto +#define RETURN_2 +#include "../libgomp.oacc-c-c++-common/routine-1.c" diff --git libgomp/testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C libgomp/testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C new file mode 100644 index 0000000..bfe2787 --- /dev/null +++ libgomp/testsuite/libgomp.oacc-c++/routine-1-template-trailing-return-type.C @@ -0,0 +1,8 @@ +// Templated routine using trailing return type syntax. + +// { dg-additional-options "-fno-exceptions" } + +#define TEMPLATE template +#define RETURN_1 auto +#define RETURN_2 -> TYPE +#include "../libgomp.oacc-c-c++-common/routine-1.c" diff --git libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C new file mode 100644 index 0000000..a7e0323 --- /dev/null +++ libgomp/testsuite/libgomp.oacc-c++/routine-1-template.C @@ -0,0 +1,8 @@ +// Templated routine. + +// { dg-additional-options "-fno-exceptions" } + +#define TEMPLATE template +#define RETURN_1 TYPE +#define RETURN_2 +#include "../libgomp.oacc-c-c++-common/routine-1.c" diff --git libgomp/testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C libgomp/testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C new file mode 100644 index 0000000..3074ba4 --- /dev/null +++ libgomp/testsuite/libgomp.oacc-c++/routine-1-trailing-return-type.C @@ -0,0 +1,9 @@ +// Routine using trailing return type syntax. + +// { dg-additional-options "-fno-exceptions" } + +#define TEMPLATE +#define TYPE int +#define RETURN_1 auto +#define RETURN_2 -> TYPE +#include "../libgomp.oacc-c-c++-common/routine-1.c" diff --git libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c index f112457..2a36b3b 100644 --- libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c +++ libgomp/testsuite/libgomp.oacc-c-c++-common/routine-1.c @@ -1,10 +1,18 @@ // { dg-additional-options "-fno-exceptions" } -#include +// Defaults, if not "#include"d from ../libgomp.oacc-c++/routine-1-*.C. +#ifndef TEMPLATE +# define TEMPLATE +# define TYPE int +# define RETURN_1 TYPE +# define RETURN_2 +#endif + #include #pragma acc routine -int fact(int n) +TEMPLATE +RETURN_1 fact(TYPE n) RETURN_2 { if (n == 0 || n == 1) return 1;