Valentin Clement 5a0b91fc28
[flang][openacc] Fix false positive error in common block resolution
The following error was triggered in the added test case.
This is a false positive.

COMMON block must be declared in the same scoping unit in which the OpenACC directive or clause appears

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D154742
2023-07-10 08:39:35 -07:00

35 lines
611 B
Fortran

! RUN: %flang_fc1 -fopenacc %s
! Check common block resolution.
! Check that symbol are correctly resolved in device, host and self clause.
subroutine sub(a)
implicit none
real :: a(10)
real :: b(10), c(10), d
common/foo/ b, d, c
integer :: i, n
!$acc declare present(/foo/)
!$acc parallel loop gang vector
do i = 1, n
b(i) = a(i) + c(i) * d
end do
end subroutine
program test_resolve04
real :: a(10), b(10)
common /foo/ b, c
!$acc data create(/foo/)
!$acc update device(/foo/)
!$acc update host(/foo/)
!$acc update self(/foo/)
!$acc end data
!$acc data copy(/foo/)
!$acc end data
end