From patchwork Tue Jul 12 13:55:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [gomp-3.1] Add a testcase for copyin of unallocated allocatable Date: Tue, 12 Jul 2011 03:55:06 -0000 From: Jakub Jelinek X-Patchwork-Id: 104373 Message-Id: <20110712135506.GQ2687@tyan-ft48-01.lab.bos.redhat.com> To: gcc-patches@gcc.gnu.org Hi! The final standard now explicitly lists how copyin should copy allocatables. Here is a testcase for something that hasn't been covered by the testsuite yet. 2011-07-12 Jakub Jelinek * testsuite/libgomp.fortran/allocatable8.f90: New test. Jakub --- libgomp/testsuite/libgomp.fortran/allocatable8.f90.jj 2011-07-12 15:42:56.000000000 +0200 +++ libgomp/testsuite/libgomp.fortran/allocatable8.f90 2011-07-12 15:45:00.000000000 +0200 @@ -0,0 +1,14 @@ +! { dg-do run } +! { dg-require-effective-target tls_runtime } +!$ use omp_lib + + integer, save, allocatable :: a(:, :) + logical :: l +!$omp threadprivate (a) + if (allocated (a)) call abort + l = .false. +!$omp parallel copyin (a) num_threads (4) reduction(.or.:l) + l = l.or.allocated (a) +!$omp end parallel + if (l.or.allocated (a)) call abort +end