From patchwork Wed Nov 25 10:00:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1405973 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CgxHL3ZHMz9s0b for ; Wed, 25 Nov 2020 21:01:16 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BEBDE3958C0D; Wed, 25 Nov 2020 10:01:13 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id C6430386181F for ; Wed, 25 Nov 2020 10:01:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C6430386181F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Thomas_Schwinge@mentor.com IronPort-SDR: AWzI+/djpgpZIXizil6EozyzmNRHPtu9NmixgZDIYqyEB6FyWn7tB+ei7AzPIc1rmSniPdi44o 2qI8KXUaqOOECd66G7i0+wApOvUFT9OzKJnDghMYRirw0eoZ5BeKwi3kmZSCGF9h7mZdebiuqM rdd/o13i5KL96XhLbkGiuLZ3279k/oQZdx6vomMuDLGy/NOs79j4XVYCHYhGww8KsKJxiPAJ2p U3vjhRw1DvdM5UF5Ad+W2y6gZmhB+Qf4j3VuO6uv0c8CIKQGhn0GmNVMfijxL5TR2jTMN+vSLx F0A= X-IronPort-AV: E=Sophos;i="5.78,368,1599552000"; d="scan'208,223";a="55482335" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 25 Nov 2020 02:01:09 -0800 IronPort-SDR: 5+39urmol9IN1meuUJn/xgI7QAPL6GiLHyH9Iy0AMCRzPbHAK1ZFdD99Ur8w+Qz32244ygNOZ6 vKNpA6zIF1+ItfMv1IvCvdLrmfeFqy9nYCBta0mFuhLB49toPjOrOZvTh0O/teGGrpyaQhfvEp e2gmgT3CO/W8f5elar1oGVz9tfedvG3HI2DGB4Ztvngcxum6Z3PE4E/HCMFpVqMVGMRMI3buit afWrt8ue2xsoSlRJJSeCaV+VNjtYyaWsrrWD48wHdQhQesTBNbDBP9nddqSCS+zuLdoo51dwew RxQ= From: Thomas Schwinge To: , Jakub Jelinek Subject: Add 'g++.dg/gomp/map-{1,2}.C' User-Agent: Notmuch/0.29.1+93~g67ed7df (https://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Wed, 25 Nov 2020 11:00:57 +0100 Message-ID: <87d00192na.fsf@dem-tschwing-1.ger.mentorg.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi! I had reason to look into OpenMP C++ 'map' clause parsing, and a testsuite enhancement to "Add 'g++.dg/gomp/map-{1,2}.C'" fell out of that, see attached. OK to push? Note two XFAILs in 'g++.dg/gomp/map-1.C' compared to the C/C++ variant. I suppose these are real, and should get resolved at some point? Grüße Thomas ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter From baf13b7df78e37ae59084c6b6ebf9dcfd0995862 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 25 Nov 2020 10:45:47 +0100 Subject: [PATCH] Add 'g++.dg/gomp/map-{1,2}.C' gcc/testsuite/ * g++.dg/gomp/map-1.C: New. * g++.dg/gomp/map-2.C: Likewise. --- gcc/testsuite/c-c++-common/gomp/map-1.c | 5 +++-- gcc/testsuite/c-c++-common/gomp/map-2.c | 5 +++-- .../{c-c++-common/gomp/map-1.c => g++.dg/gomp/map-1.C} | 10 ++++++---- .../{c-c++-common/gomp/map-2.c => g++.dg/gomp/map-2.C} | 6 ++++-- 4 files changed, 16 insertions(+), 10 deletions(-) copy gcc/testsuite/{c-c++-common/gomp/map-1.c => g++.dg/gomp/map-1.C} (95%) copy gcc/testsuite/{c-c++-common/gomp/map-2.c => g++.dg/gomp/map-2.C} (93%) diff --git a/gcc/testsuite/c-c++-common/gomp/map-1.c b/gcc/testsuite/c-c++-common/gomp/map-1.c index 508dc8d6b01..31100b0396b 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-1.c +++ b/gcc/testsuite/c-c++-common/gomp/map-1.c @@ -1,5 +1,6 @@ -/* { dg-do compile } */ -/* { dg-options "-fopenmp" } */ +/* Test 'map' clause diagnostics. */ + +/* See also corresponding C++ variant: '../../g++.dg/gomp/map-1.C'. */ extern int a[][10], a2[][10]; int b[10], c[10][2], d[10], e[10], f[10]; diff --git a/gcc/testsuite/c-c++-common/gomp/map-2.c b/gcc/testsuite/c-c++-common/gomp/map-2.c index 101f4047b85..cd69f6b9a57 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-2.c +++ b/gcc/testsuite/c-c++-common/gomp/map-2.c @@ -1,5 +1,6 @@ -/* { dg-do compile } */ -/* { dg-options "-fopenmp" } */ +/* Test 'map' clause diagnostics. */ + +/* See also corresponding C++ variant: '../../g++.dg/gomp/map-2.C'. */ void foo (int *p, int (*q)[10], int r[10], int s[10][10]) diff --git a/gcc/testsuite/c-c++-common/gomp/map-1.c b/gcc/testsuite/g++.dg/gomp/map-1.C similarity index 95% copy from gcc/testsuite/c-c++-common/gomp/map-1.c copy to gcc/testsuite/g++.dg/gomp/map-1.C index 508dc8d6b01..be9aca1a9fb 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-1.c +++ b/gcc/testsuite/g++.dg/gomp/map-1.C @@ -1,5 +1,6 @@ -/* { dg-do compile } */ -/* { dg-options "-fopenmp" } */ +/* Test data clause diagnostics. */ + +/* See also corresponding C/C++ variant: '../../c-c++-common/gomp/map-1.c'. */ extern int a[][10], a2[][10]; int b[10], c[10][2], d[10], e[10], f[10]; @@ -16,11 +17,12 @@ int t[10]; void bar (int *); #pragma omp end declare target +template void foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], int g2[3][10], int h2[4][8], int i2[2][10], int j2[][9]) { - #pragma omp target map(to: bar[2:5]) /* { dg-error "is not a variable" } */ + #pragma omp target map(to: bar[2:5]) /* { dg-error "is not a variable" "TODO" { xfail *-*-* } } */ ; #pragma omp target map(from: t[2:5]) /* { dg-error "is threadprivate variable" } */ ; @@ -39,7 +41,7 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9], #pragma omp target map(alloc: s2) /* { dg-error "'s2' does not have a mappable type in 'map' clause" } */ ; #pragma omp target map(to: a[:][:]) /* { dg-error "array type length expression must be specified" } */ - bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" } */ + bar (&a[0][0]); /* { dg-error "referenced in target region does not have a mappable type" "TODO" { xfail *-*-* } } */ #pragma omp target map(tofrom: b[-1:]) /* { dg-error "negative low bound in array section" } */ bar (b); #pragma omp target map(tofrom: c[:-3][:]) /* { dg-error "negative length in array section" } */ diff --git a/gcc/testsuite/c-c++-common/gomp/map-2.c b/gcc/testsuite/g++.dg/gomp/map-2.C similarity index 93% copy from gcc/testsuite/c-c++-common/gomp/map-2.c copy to gcc/testsuite/g++.dg/gomp/map-2.C index 101f4047b85..7fdd61c4998 100644 --- a/gcc/testsuite/c-c++-common/gomp/map-2.c +++ b/gcc/testsuite/g++.dg/gomp/map-2.C @@ -1,6 +1,8 @@ -/* { dg-do compile } */ -/* { dg-options "-fopenmp" } */ +/* Test data clause diagnostics. */ +/* See also corresponding C/C++ variant: '../../c-c++-common/gomp/map-2.c'. */ + +template void foo (int *p, int (*q)[10], int r[10], int s[10][10]) { -- 2.17.1