From patchwork Fri Aug 18 17:39:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 13663 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1569435vqi; Fri, 18 Aug 2023 10:40:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEI+TWAfgkx1g3LmrgYCy53FAILNxvdx0nawJ8o0MoqfguuCqn/PfsSqav+Tc929gEOo+sR X-Received: by 2002:a17:906:535d:b0:99b:bf52:6d4f with SMTP id j29-20020a170906535d00b0099bbf526d4fmr2568439ejo.33.1692380446826; Fri, 18 Aug 2023 10:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692380446; cv=none; d=google.com; s=arc-20160816; b=UMlOIDv1dQg4+97mw6/Y7ADLRuCKNY2Pi/nY05kTJav7YyyNxiVfkBe/gSbgtUyp2D eQXQwleCqBnZNyDblv3p9YgPuZp+GIn0zuQ7aII3EnXcOcDeQ2LHVMcLO8WkpkN4THq2 fJIcsqgkiry70RZHEm0bfHXslZaMnPIfCpdQU7+0ntqTp9XgdnMk4JZzM4QS9jNaNWny dJxwyfGIilb4wARfD5VPi67n4Fy3js25kYC9KQiLEpQDa00AHIex1QoVSkAPxAsJ3zKF jSK/XHmlcjIRMvMKy//kOgG6Ece0oEa0ZQfG50LDbSmafqvgmNq8wiJORaLAMV0E8uFJ e7Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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 :dmarc-filter:delivered-to; bh=Wi4DK5/kYlcOXsxBEIq2/HzIAb5kjGHMMgkzZvKgZXs=; fh=FjmNZF1SyD2luHyimf3O/CuPis5iJRQL/WGF12E3/GM=; b=yPuM6iLNbrb/ly4JfyDkLIohOEWz32v3A0O7ieISbl+Y9bNos8Ezq8anqR7LWiHsDA w4mlDTOQzgY5JSMMRJM+nifHJwdDbNhZ8qKFIjf6aq2Np3K9s42tYy/2UxmQmV0jRF0v ZNh8yL3CtofpjVHayKXzXUXErbXTl5rwU9jd8VLIvOokKz7pOQVsktG1NK426j/z8zjQ 9lYnK/RrekUx0d2APSL55j464X9aDk/mw1oFO9Z9JV/FrdT+XHw0+HsCLTp2Rw15BMnx bMZ41CnTZm9SAErkm4EZnDVTADVwCr8Wo74ixfEW2In9m6o/TqNc5tild8DPc37kFkZq nFkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ga17-20020a170906b85100b009980c2658desi1614802ejb.76.2023.08.18.10.40.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 10:40:46 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 4A0BE38319F1 for ; Fri, 18 Aug 2023 17:40:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 7A9CA3860765 for ; Fri, 18 Aug 2023 17:40:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7A9CA3860765 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="6.01,183,1684828800"; d="scan'208";a="14812567" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 18 Aug 2023 09:40:00 -0800 IronPort-SDR: yd/o0po1bs/vqK9CULqRBsvilEeAjen0+EidG0mkYeQMz4fGgQA3p0VfxNFK+xdHdK5uQrLt7R Rp1YKLqcdAR9ID5XiW8TQeRklPwJNaSv2XCDLNGejMzb3UTf0TPzR14ciTs/zgiPvK+oaSwL0l z5rOb0Z+cEi+0P5VuQ2z6AsSkSL8ZLNivzR9smEoocPpiX2nUf8RD6kH/iIm4+TA1hiQnEdYG8 IE2RDqwip6ktSuGi061NQ8yFtNA2bUGS7pjaHoZ1PMsOoNorxwEDGYC2jVDiQ0x9YaU73ehvXJ nNM= From: Sandra Loosemore To: CC: , , Subject: [OG13, committed 0/3] C++ attribute syntax fixes/testcases Date: Fri, 18 Aug 2023 11:39:34 -0600 Message-ID: <20230818173938.430758-1-sandra@codesourcery.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-10.mgc.mentorg.com (147.34.90.210) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774589519494624108 X-GMAIL-MSGID: 1774589519494624108 I've had a task item to ensure that g++ accepts the standard C++ attribute syntax form for all (currently-implemented) OpenMP 5.1 directives, and that there are tests to verify this. I used some scripting to scan for existing testcases given a list of the directives, which I extracted from the reference card on the OpenMP web site. It looked to me that on mainline all the supported directives had tests already, but on OG13 I found that "metadirective", "declare mapper", and the loop transforms "tile" and "unroll" had no tests, and on further investigation all of them had bugs, too. I didn't manually examine all the existing tests for other directives, BTW, but the ones I spot-checked seem to have good coverage. The new tests are mostly just adapted from a subset of existing pragma-syntax tests. -Sandra Sandra Loosemore (3): OpenMP: C++ attribute syntax fixes/testcases for "metadirective" OpenMP: C++ attribute syntax fixes/testcases for "declare mapper" OpenMP: C++ attribute syntax fixes/testcases for loop transformations gcc/c-family/ChangeLog.omp | 4 + gcc/c-family/c-omp.cc | 4 +- gcc/cp/ChangeLog.omp | 26 +++ gcc/cp/parser.cc | 87 ++++++--- gcc/testsuite/ChangeLog.omp | 30 +++ .../g++.dg/gomp/attrs-declare-mapper-3.C | 31 ++++ .../g++.dg/gomp/attrs-declare-mapper-4.C | 74 ++++++++ .../g++.dg/gomp/attrs-declare-mapper-5.C | 26 +++ .../g++.dg/gomp/attrs-declare-mapper-6.C | 22 +++ .../g++.dg/gomp/attrs-metadirective-1.C | 40 ++++ .../g++.dg/gomp/attrs-metadirective-2.C | 74 ++++++++ .../g++.dg/gomp/attrs-metadirective-3.C | 31 ++++ .../g++.dg/gomp/attrs-metadirective-4.C | 41 +++++ .../g++.dg/gomp/attrs-metadirective-5.C | 24 +++ .../g++.dg/gomp/attrs-metadirective-6.C | 31 ++++ .../g++.dg/gomp/attrs-metadirective-7.C | 31 ++++ .../g++.dg/gomp/attrs-metadirective-8.C | 16 ++ .../gomp/loop-transforms/attrs-tile-1.C | 164 +++++++++++++++++ .../gomp/loop-transforms/attrs-tile-2.C | 174 ++++++++++++++++++ .../gomp/loop-transforms/attrs-tile-3.C | 111 +++++++++++ .../gomp/loop-transforms/attrs-unroll-1.C | 135 ++++++++++++++ .../gomp/loop-transforms/attrs-unroll-2.C | 81 ++++++++ .../gomp/loop-transforms/attrs-unroll-3.C | 20 ++ .../loop-transforms/attrs-unroll-inner-1.C | 15 ++ .../loop-transforms/attrs-unroll-inner-2.C | 29 +++ .../loop-transforms/attrs-unroll-inner-3.C | 71 +++++++ 26 files changed, 1366 insertions(+), 26 deletions(-) create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-declare-mapper-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-declare-mapper-4.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-declare-mapper-5.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-declare-mapper-6.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-4.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-5.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-6.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-7.C create mode 100644 gcc/testsuite/g++.dg/gomp/attrs-metadirective-8.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-tile-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-tile-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-tile-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-unroll-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-unroll-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-unroll-3.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-unroll-inner-1.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-unroll-inner-2.C create mode 100644 gcc/testsuite/g++.dg/gomp/loop-transforms/attrs-unroll-inner-3.C