From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 91A173857B84 for ; Mon, 4 Jul 2022 07:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 91A173857B84 Received: by mail-ed1-x530.google.com with SMTP id z19so10570965edb.11 for ; Mon, 04 Jul 2022 00:50:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=uNw/dcgoS2cLrO/C5KMraVFtfmtM04UkpxGNElmsp8s=; b=dIq3OetQFoGNmY0j1g9Xys8F71/UMSdJfTsGKkJVRLtVaEONaDAZrWxccCAb8W0sg0 aQAitiQZp8LpsJbFr/AnhpsUm+//Uyxu3dVk0dXMSlyMRFgZdFEUzYfc9XdhIjBW1fks msQKVjShZ0FtUl5xl0/Af5Nmeq9GAjOKDVYa7Z8QbjfwT6GT4snhlUKOfNBmie3+OYGO vEIm+3fx6naTc2GXTq9g0J/AbCMPLKy2/ogOpWlqOqA9eWiWeUYdeq2PkvAKxOhnL5qZ S0ORyOgeUH4ZK1TMJmKj6RmqV6WULo9YaKug0a2npj0epJ6YLJG1DGbEUI76Ff4MDP3w iNXw== X-Gm-Message-State: AJIora/cxjb/beG8u1im6AbnSXm1LCLY4wGQ4hJU88ftuKDPH7THvYft VeWVc93FWfzCITKki2ARGR366bkjldVLWw== X-Google-Smtp-Source: AGRyM1vEuznbjhjjv2x7IdSDMIweroI0Xf5Wjr8ZxG7nSDSrXMRf/wX4CHhz72cu5YWvusfopS0pbA== X-Received: by 2002:aa7:cc0b:0:b0:437:9c60:127b with SMTP id q11-20020aa7cc0b000000b004379c60127bmr36113181edt.320.1656921005617; Mon, 04 Jul 2022 00:50:05 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id 8-20020a170906300800b0072aadbd48c7sm2606477ejz.84.2022.07.04.00.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 00:50:05 -0700 (PDT) Date: Mon, 4 Jul 2022 07:50:04 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Claire Dross Subject: [Ada] Add GNAT specific pragmas to the equivalent Assertion_Policy for -gnata Message-ID: <20220704075004.GA98997@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 07:50:10 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline All assertion pragmas are enabled by default when using -gnata. We need to add the GNAT specific ones to the list. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * doc/gnat_ugn/building_executable_programs_with_gnat.rst (Debugging and Assertion Control): Add GNAT specific assertion pragmas to the equivalent Assertion_Policy for the -gnata option. * gnat_ugn.texi: Regenerate. --MGYHOYXEY6WxJCY8 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -4331,15 +4331,31 @@ Debugging and Assertion Control Which is a shorthand for:: pragma Assertion_Policy - (Assert => Check, - Static_Predicate => Check, - Dynamic_Predicate => Check, - Pre => Check, - Pre'Class => Check, - Post => Check, - Post'Class => Check, - Type_Invariant => Check, - Type_Invariant'Class => Check); + -- Ada RM assertion pragmas + (Assert => Check, + Static_Predicate => Check, + Dynamic_Predicate => Check, + Pre => Check, + Pre'Class => Check, + Post => Check, + Post'Class => Check, + Type_Invariant => Check, + Type_Invariant'Class => Check, + Default_Initial_Condition => Check, + -- GNAT specific assertion pragmas + Assert_And_Cut => Check, + Assume => Check, + Contract_Cases => Check, + Debug => Check, + Ghost => Check, + Initial_Condition => Check, + Loop_Invariant => Check, + Loop_Variant => Check, + Postcondition => Check, + Precondition => Check, + Predicate => Check, + Refined_Post => Check, + Subprogram_Variant => Check); The pragmas ``Assert`` and ``Debug`` normally have no effect and are ignored. This switch, where ``a`` stands for 'assert', causes diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -21,7 +21,7 @@ @copying @quotation -GNAT User's Guide for Native Platforms , May 24, 2022 +GNAT User's Guide for Native Platforms , Jun 24, 2022 AdaCore @@ -12853,15 +12853,31 @@ Which is a shorthand for: @example pragma Assertion_Policy - (Assert => Check, - Static_Predicate => Check, - Dynamic_Predicate => Check, - Pre => Check, - Pre'Class => Check, - Post => Check, - Post'Class => Check, - Type_Invariant => Check, - Type_Invariant'Class => Check); +-- Ada RM assertion pragmas + (Assert => Check, + Static_Predicate => Check, + Dynamic_Predicate => Check, + Pre => Check, + Pre'Class => Check, + Post => Check, + Post'Class => Check, + Type_Invariant => Check, + Type_Invariant'Class => Check, + Default_Initial_Condition => Check, +-- GNAT specific assertion pragmas + Assert_And_Cut => Check, + Assume => Check, + Contract_Cases => Check, + Debug => Check, + Ghost => Check, + Initial_Condition => Check, + Loop_Invariant => Check, + Loop_Variant => Check, + Postcondition => Check, + Precondition => Check, + Predicate => Check, + Refined_Post => Check, + Subprogram_Variant => Check); @end example The pragmas @code{Assert} and @code{Debug} normally have no effect and @@ -29249,8 +29265,8 @@ to permit their use in free software. @printindex ge -@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @anchor{cf}@w{ } +@anchor{gnat_ugn/gnat_utility_programs switches-related-to-project-files}@w{ } @c %**end of body @bye --MGYHOYXEY6WxJCY8--