From patchwork Wed Jan 10 13:14:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 186864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp781872dyi; Wed, 10 Jan 2024 05:15:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVYruzODIVEnEsePauzODqUJihSQsGPvBw6UhuX1mwWX/IXA8uh9hlZLSKHAyP/OXXomRD X-Received: by 2002:ac8:5cc7:0:b0:429:bcc5:4d0c with SMTP id s7-20020ac85cc7000000b00429bcc54d0cmr154704qta.12.1704892558413; Wed, 10 Jan 2024 05:15:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1704892558; cv=pass; d=google.com; s=arc-20160816; b=fe8jixjxiXi76YFOKihAiCxZXP8IZtDwpp7bwForxp1WCS1+qWw5+OwUjKDIlPK4I6 J0DH9xqRyBE/J7Jq6QGqWgDEKhe2Uif3GfTMRhv+lCVY5EbLVdAAdaUP4NMLB32TnY78 JBO2bVX0XYXh/zFqtMPYgrkVz7sLplEnJXf/Ftv8F5hdSTQFfivtoghDKAvYXG+xXa+T Lv5MEfAqWL/Qvnw7wcIrsjDFgXHoSuDyFl63mE1t9yZl3bB1pI70PchblDijMUNOZmPV I6hyBbYaU6+47q4ES0GTj8yuzU9JXYoDx567V3j4lUtytOhETyhFATquMOYKgHGbOK03 QwFg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:ironport-sdr :arc-filter:dmarc-filter:delivered-to; bh=XYbCC4EK/A4k8x8Z9wuHXe8UEW7r+VKzHWQ4VDGjH+I=; fh=GFHaucKm5PZw/dSNTje+hjMtjErRiHBjhLgFQhMoUr8=; b=mseSJHV3KgAQvPZs7Q6dSNasTIJZaJ25DWV54bAWYu/HQQS7NvuDui889EpEQTCxat MhWN/fHVn7G6pS0Pt6wTpzTRfUWL8nUkreqtUAH33YQnodGzb4iJMOA9CBEEBx3Nwfu+ J0LKpDZSjTIhxjtqg1+vJgjBX+DCbMTB7q7T4FIiWKeUbQpI9ZD3BpM7PAJshFSll4Iz oPpA0KdSW2CX+olDOYwSfZ2URrf4cxSuB58DYNp4WnDtE0iJF9VXHZQZuYiJ3R1g6sGg 8HjiLQjoJIDLITD2h+rEe12yoqwkxUtlyjNDC+QjSpp17IFX6QDDVnVfvKx3+R0Nh6PP PNww== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ay18-20020a05622a229200b004299200ed9bsi4056127qtb.370.2024.01.10.05.15.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 05:15:58 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 247F138582B9 for ; Wed, 10 Jan 2024 13:15:58 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 92E7C3858C66 for ; Wed, 10 Jan 2024 13:15:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 92E7C3858C66 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 92E7C3858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704892507; cv=none; b=vgiEWqx7YoSnpkKWNYFQTJzGr9oUvdsTPA9ghnGHzrTB/Tz92VksXnUBS2m7SvVqqAVIE5cWdxn7HVUA33Vs0qV17s5SFSD2xat1yfq7j3FbtDlbY9dYg/ylzxj/lYxO4T7CqKUZBJY8sJgnmye+FDX0Omop1a5n1NCiGvfRjBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704892507; c=relaxed/simple; bh=JB01nu+tzDhAl3p8F+dXPapli9lYjvy8o1XBLfpcekk=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=rVOkMMi2K0X+zEdBBxFcPOaO5OHNwFI3ZWZhC5Hc6xEzK2Mu1Co13OLUiLnvWsDskvK9Y0I93kWb/mtCde9C/RB7hPhhXRPCrp6nGoqoC+2kUwPhqKXF1Sn4QnMtzEyNOKsuYvTTaTvr2eUoMzPuXbSPcg0DS+pVEnEjce5g/Vw= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: mdC+3O3QSM2bm1BbUpHfqQ== X-CSE-MsgGUID: nd/8KNsgRMW+Hp3h96mTuA== X-IronPort-AV: E=Sophos;i="6.04,184,1695715200"; d="scan'208";a="31179635" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 10 Jan 2024 05:15:03 -0800 IronPort-SDR: RLX+FVu0owVVy0SJpbRBY1OjKh0Dzb+K6ilObOwRuEfBuoXEZUgy9QcMVEb45CLQPceQ1Dkydu 3D1r/RArk3GsS3UI3SbZatzILjNeAPyRaOPhqAON7ftehJIZs5MqHxQwC9PK+Whs7Vpf0GE0em TYtzoeSgHvGeCoclsI6GbFpkuJfxkxajM0P1++dpICIf1UXeKn89scqC4LpNsyo7EhsuXXj7Wx 9MTG9CcVjDw0aPQhcEZqho3hIXpfk8k7WVNwyfMBeNtWVvNY6djbvd7DlVA0ViCM1TNMyrj/YI 8Qg= From: Julian Brown To: CC: Subject: [PATCH] OpenMP: Fix g++.dg/gomp/bad-array-section-10.C for C++23 and up Date: Wed, 10 Jan 2024 13:14:48 +0000 Message-ID: <20240110131448.989596-1-julian@codesourcery.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787709419363371716 X-GMAIL-MSGID: 1787709419363371716 This patch adjusts diagnostic output for C++23 and above for the test case mentioned in the commit title. I will apply shortly as obvious. 2024-01-10 Julian Brown gcc/testsuite/ * g++.dg/gomp/bad-array-section-10.C: Adjust diagnostics for C++23 and up. --- gcc/testsuite/g++.dg/gomp/bad-array-section-10.C | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C b/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C index 393b0fefe51..286e72e9f64 100644 --- a/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C +++ b/gcc/testsuite/g++.dg/gomp/bad-array-section-10.C @@ -6,12 +6,15 @@ void foo() int arr1[40]; #pragma omp target map(arr1[4,C:]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } +// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } #pragma omp target map(arr1[4,5:C,7]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } +// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } #pragma omp target map(arr1[:8,C,10]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } +// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } } @@ -20,12 +23,15 @@ int main() int arr1[40]; #pragma omp target map(arr1[4,5:]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } +// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } #pragma omp target map(arr1[4,5:6,7]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } +// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } #pragma omp target map(arr1[:8,9,10]) // { dg-warning "top-level comma expression in array subscript is deprecated" "" { target c++20_only } .-1 } +// { dg-error "cannot use multidimensional subscript in OpenMP array section" "" { target c++23 } .-2 } { } foo<6, 9> ();