Files
gcc-reflection/libgomp/testsuite/libgomp.fortran/allocators-2.f90
supers1ngular 52d7f5b103 openmp: Bump Version from 4.5 to 5.2 (3/4)
Implements the OpenMP 5.2 Fortran deprecations. Uses the warning
established in patch 1/4, -Wdeprecated-openmp, for said deprecations.
Similarly, we do not implement the relaxing of constraints for the
interop construct since it is not a deprecation. However, the
deprecation for 'uses_allocators' is implemented, since support
exists in Fortran mainline. Additionally implements the
Fortran-specific deprecation for executable allocate directives,
and adds new tests.

gcc/fortran/ChangeLog:

	* openmp.cc (gfc_match_omp_clause_reduction): Deprecate '-'
	operator for reductions.
	(gfc_match_omp_clause_uses_allocators): Deprecate
	allocator(traits) pattern for 'uses_allocators'.
	(gfc_match_omp_clauses): Deprecate 'sink' and 'source' for
	'depend' clause. Deprecate list items as arguments with 'linear'
	clause. Deprecate non-comma-separated modifiers for the map
	clause. Deprecate 'to' clause with declare target.
	(gfc_match_omp_declare_target): Whitespace.
	(match_omp_metadirective): Deprecate 'default' clause on
	metadirectives.
	(resolve_omp_clauses): Deprecate executable allocate directives.

libgomp/ChangeLog:

	* testsuite/libgomp.fortran/allocate-8a.f90: Suppress warnings.
	* testsuite/libgomp.fortran/allocators-1.f90: Ditto.
	* testsuite/libgomp.fortran/allocators-2.f90: Ditto.
	* testsuite/libgomp.fortran/allocators-4.f90: Ditto.
	* testsuite/libgomp.fortran/declare-target-1.f90: Ditto.
	* testsuite/libgomp.fortran/declare-target-2.f90: Ditto.
	* testsuite/libgomp.fortran/declare-target-indirect-1.f90: Ditto.
	* testsuite/libgomp.fortran/declare-target-indirect-2.f90: Ditto.
	* testsuite/libgomp.fortran/doacross1.f90: Ditto.
	* testsuite/libgomp.fortran/doacross2.f90: Ditto.
	* testsuite/libgomp.fortran/doacross3.f90: Ditto.
	* testsuite/libgomp.fortran/map-alloc-ptr-2.f90: Ditto.
	* testsuite/libgomp.fortran/pr84418-1.f90: Ditto.
	* testsuite/libgomp.fortran/pr84418-2.f90: Ditto.
	* testsuite/libgomp.fortran/reduction1.f90: Ditto.
	* testsuite/libgomp.fortran/udr11.f90: Ditto.
	* testsuite/libgomp.fortran/uses_allocators_1.f90: Ditto.
	* testsuite/libgomp.fortran/uses_allocators_2.f90: Ditto.
	* testsuite/libgomp.fortran/dep-uses-allocators.f90: New test.

gcc/testsuite/ChangeLog:

	* gfortran.dg/gomp/allocate-14.f90: Suppress warnings.
	* gfortran.dg/gomp/allocate-16.f90: Ditto.
	* gfortran.dg/gomp/allocate-5.f90: Ditto.
	* gfortran.dg/gomp/allocate-6.f90: Ditto.
	* gfortran.dg/gomp/allocate-7.f90: Ditto.
	* gfortran.dg/gomp/allocators-3.f90: Ditto.
	* gfortran.dg/gomp/declare-simd-2.f90: Ditto.
	* gfortran.dg/gomp/declare-simd-6.f90: Ditto.
	* gfortran.dg/gomp/declare-target-1.f90: Ditto.
	* gfortran.dg/gomp/declare-target-2.f90: Ditto.
	* gfortran.dg/gomp/declare-target-4.f90: Ditto.
	* gfortran.dg/gomp/declare-target-5.f90: Ditto.
	* gfortran.dg/gomp/declare-target-indirect-1.f90: Ditto.
	* gfortran.dg/gomp/declare-target-indirect-2.f90: Ditto.
	* gfortran.dg/gomp/declare-variant-10.f90: Ditto.
	* gfortran.dg/gomp/declare-variant-8.f90: Ditto.
	* gfortran.dg/gomp/implicit-save.f90: Ditto.
	* gfortran.dg/gomp/linear-1.f90: Ditto.
	* gfortran.dg/gomp/linear-2.f90: Ditto.
	* gfortran.dg/gomp/linear-3.f90: Ditto.
	* gfortran.dg/gomp/linear-4.f90: Ditto.
	* gfortran.dg/gomp/linear-6.f90: Ditto.
	* gfortran.dg/gomp/map-12.f90: Ditto.
	* gfortran.dg/gomp/map-6.f90: Ditto.
	* gfortran.dg/gomp/map-7.f90: Ditto.
	* gfortran.dg/gomp/map-8.f90: Ditto.
	* gfortran.dg/gomp/order-8.f90: Ditto.
	* gfortran.dg/gomp/pr83977.f90: Ditto.
	* gfortran.dg/gomp/reduction1.f90: Ditto.
	* gfortran.dg/gomp/schedule-modifiers-2.f90: Ditto.
	* gfortran.dg/gomp/workshare-reduction-55.f90: Ditto.
	* gfortran.dg/gomp/workshare-reduction-56.f90: Ditto.
	* gfortran.dg/gomp/workshare-reduction-57.f90: Ditto.
	* gfortran.dg/gomp/workshare-reduction-58.f90: Ditto.
	* gfortran.dg/gomp/52-deps.f90: New test.
2025-12-11 08:12:50 -08:00

103 lines
2.8 KiB
Fortran

! { dg-additional-options "-fopenmp-allocators" }
! { dg-additional-options "-Wno-deprecated-openmp" }
module m
implicit none (type, external)
type t
integer, allocatable :: Acomp, Bcomp(:)
end type t
contains
subroutine intent_out(aa, bb, cc, dd, ee, ff)
integer, allocatable,intent(out) :: aa, bb(:)
type(t), intent(out) :: cc, dd(4)
type(t), allocatable, intent(out) :: ee, ff(:)
end
subroutine q(qa, qb, qc, qd, qe, qf)
integer, allocatable :: qa, qb(:)
type(t) :: qc, qd(4)
type(t), allocatable :: qe, qf(:)
call intent_out (qa, qb, qc, qd, qe, qf)
end subroutine q
subroutine r
integer, allocatable :: r1, r2(:)
type(t) :: r3, r4(4)
type(t), allocatable :: r5, r6(:)
call q(r1,r2,r3,r4,r5,r6)
allocate(r1,r2(3))
allocate(r5,r6(4))
allocate(r3%Acomp, r3%Bcomp(2))
allocate(r4(2)%Acomp, r4(2)%Bcomp(2))
allocate(r5%Acomp, r5%Bcomp(2))
allocate(r6(3)%Acomp, r6(3)%Bcomp(2))
!$omp allocate align(128)
allocate(r4(3)%Acomp, r4(3)%Bcomp(2), &
r6(1)%Acomp, r6(1)%Bcomp(2))
if (mod (loc (r4(3)%Acomp), 128) /= 0) stop 1
if (mod (loc (r4(3)%Bcomp), 128) /= 0) stop 2
if (mod (loc (r6(1)%Acomp), 128) /= 0) stop 3
if (mod (loc (r6(1)%Bcomp), 128) /= 0) stop 3
call q(r1,r2,r3,r4,r5,r6)
!$omp allocate align(64)
allocate(r1,r2(3))
if (mod (loc (r1), 64) /= 0) stop 1
if (mod (loc (r2), 64) /= 0) stop 1
!$omp allocate align(64)
allocate(r5,r6(4))
if (mod (loc (r5), 64) /= 0) stop 1
if (mod (loc (r6), 64) /= 0) stop 1
!$omp allocate align(64)
allocate(r3%Acomp, r3%Bcomp(2))
if (mod (loc (r3%Acomp), 64) /= 0) stop 1
if (mod (loc (r3%Bcomp), 64) /= 0) stop 1
!$omp allocate align(64)
allocate(r4(2)%Acomp, r4(2)%Bcomp(2))
if (mod (loc (r4(2)%Acomp), 64) /= 0) stop 1
if (mod (loc (r4(2)%Bcomp), 64) /= 0) stop 1
!$omp allocate align(64)
allocate(r5%Acomp, r5%Bcomp(2))
if (mod (loc (r5%Acomp), 64) /= 0) stop 1
if (mod (loc (r5%Bcomp), 64) /= 0) stop 1
!$omp allocate align(64)
allocate(r6(3)%Acomp, r6(3)%Bcomp(2))
if (mod (loc (r6(3)%Acomp), 64) /= 0) stop 1
if (mod (loc (r6(3)%Bcomp), 64) /= 0) stop 1
!$omp allocate align(128)
allocate(r4(3)%Acomp, r4(3)%Bcomp(2), &
r6(1)%Acomp, r6(1)%Bcomp(2))
if (mod (loc (r4(3)%Acomp), 128) /= 0) stop 1
if (mod (loc (r4(3)%Bcomp), 128) /= 0) stop 2
if (mod (loc (r6(1)%Acomp), 128) /= 0) stop 3
if (mod (loc (r6(1)%Bcomp), 128) /= 0) stop 3
call q(r1,r2,r3,r4,r5,r6)
end subroutine r
end
subroutine s
use m, only : t
implicit none (type, external)
type(t) :: xx
integer :: i, iiiiii
i = 4
!$omp allocate
allocate(xx%Acomp, xx%Bcomp(4))
deallocate(xx%Acomp, xx%Bcomp)
!$omp allocate
allocate(xx%Acomp, xx%Bcomp(4))
xx = t(1, [1,2])
end
program main
use m, only: r
implicit none (type, external)
external s
call s
call r
end