From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by sourceware.org (Postfix) with ESMTPS id 4A7C038485B4 for ; Tue, 10 May 2022 05:28:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4A7C038485B4 Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-2f7b815ac06so167406057b3.3 for ; Mon, 09 May 2022 22:28:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=y72S2wEjkB1TMBdT8jwWEnWhrC4CaL7S4OKRFGFXK2A=; b=LmKdDgvqUnnQeLwKdcMdRxH1qNSL6YRmNCBxHpEeGR3OziwZuFqcH9PgByvjkNW1td edj2LBM7VjTkRzKQxralZGTJKBfATBGZQHecLIbCkDM6PV9XzNDn/Go6mk3HkCCxl+KL frDy+/WTSbxoVGj5C5Q6lhCplOny00lAflIDTV2WOqT+GG4F17EXCJscBRxG9tWpxuMt qQJ29OKQ2+D9lLds0KzhR80eHn1jwTbAEUKB8WofS2fmulSRUFAEVP0UWfNHlLtPBw47 M3BZBXCLIhPXWcext8F1Waj/x1AZ629LHI+rC2adj4L08UQq464BYcjlennMT8HZKh7s hiDw== X-Gm-Message-State: AOAM531VuU0N/fbrnK1+K17QzXjr0C4MhRvLWjqKez3clsj3B1ygm+mf Vnjr206VzwjnjphaKRbTp3YqG6ALJBXiE9cbYZkMt1l11mfXnFikuwMY57JoX8aPh+iq1buKOXS bYgiy2JeHlThBGFMDoJ+Dgj68uP9ZjVkfoJpRs3Ec4b06FQ5PHWCkPCDxGEtGWmdBX7cH3lpqqU are+r4B9KrXl4CYRuWTSU= X-Google-Smtp-Source: ABdhPJw46v5kMt3GVNLOQQ0IX9UXCdyZ3H+VT1ARAEKiXhfpntTdRgoIqEn07exIx0i6gy6zB+o0g9Oe2WAJcDyK1Ok= X-Received: by 2002:a81:784b:0:b0:2f8:90b7:ade1 with SMTP id t72-20020a81784b000000b002f890b7ade1mr18289454ywc.215.1652160505380; Mon, 09 May 2022 22:28:25 -0700 (PDT) MIME-Version: 1.0 From: Damian Rouson Date: Mon, 9 May 2022 22:28:14 -0700 Message-ID: Subject: PR 105542 - [F03] Orthogonal standard-conforming type finalization tests To: fortran@gcc.gnu.org Cc: Wileam Yonatan Phan , Brad Richardson X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, TXREP, T_SCC_BODY_TEXT_LINE, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 05:28:29 -0000 In case it's useful to gfortran developers, the Reference-Counter repository (https://github.com/sourceryinstitute/reference-counter) contains a test/compiler_test.f90 file that separately tests each of the scenarios in which Fortran 2018 clause 7.5.6.3 requires type finalization to occur. Thanks to the contributions of Wileam Phan and Brad Richardson, one function tests each scenario. A comment near the top of each such function cites the paragraph number of the corresponding requirement. To download and run the tests on macOS or Linux with gfortran 12.1.0 and the Fortran Package Manager (fpm) already installed, execute the following commands: git clone https://github.com/sourceryinstitute/reference-counter cd reference-counter fpm test for which the trailing output is Running Tests Test that The compiler finalizes a non-allocatable object on the LHS of an intrinsic assignment finalizes an allocated allocatable LHS of an intrinsic assignment finalizes a target when the associated pointer is deallocated finalizes an object upon explicit deallocation finalizes a non-pointer non-allocatable array object at the END statement finalizes a non-pointer non-allocatable object at the end of a block construct finalizes a function reference on the RHS of an intrinsic assignment finalizes a specification expression function result finalizes an intent(out) derived type dummy argument finalizes an allocatable component object A ref_reference does not leak when constructed, assigned, and then explicitly freed A total of 11 test cases Failed Took 1.94e-4 seconds Test that The compiler finalizes a non-allocatable object on the LHS of an intrinsic assignment Expected |1| but got |0| finalizes an allocated allocatable LHS of an intrinsic assignment Expected |1| but got |0| finalizes a function reference on the RHS of an intrinsic assignment Expected |1| but got |0| finalizes a specification expression function result Expected |1| but got |0| 4 of 11 cases failed 4 of 11 assertions failed STOP 1 Execution failed for object " reference-counter-test " *cmd_run*:stopping due to failed executions STOP 1