forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang] Add semantic checks for cray pointer usage in DSA list (llvm#…
…121028) Problems: - Cray pointee cannot be used in the DSA list (If used results in segmentation fault) - Cray pointer has to be in the DSA list when Cray pointee is used in the default (none) region Fix: Added required semantic checks along the tests Reference from the documentation (OpenMP 5.0: 2.19.1): - Cray pointees have the same data-sharing attribute as the storage with which their Cray pointers are associated.
1 parent
f30ff0b
commit 990774a
Showing
4 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
!RUN: %python %S/../test_errors.py %s %flang -fopenmp | ||
subroutine test_cray_pointer_usage | ||
implicit none | ||
real(8) :: var(*), pointee(2) | ||
pointer(ivar, var) | ||
|
||
pointee = 42.0 | ||
ivar = loc(pointee) | ||
|
||
!$omp parallel num_threads(2) default(none) | ||
! ERROR: The DEFAULT(NONE) clause requires that the Cray Pointer 'ivar' must be listed in a data-sharing attribute clause | ||
print *, var(1) | ||
!$omp end parallel | ||
|
||
! ERROR: Cray Pointee 'var' may not appear in PRIVATE clause, use Cray Pointer 'ivar' instead | ||
!$omp parallel num_threads(2) default(none) private(var) | ||
print *, var(1) | ||
!$omp end parallel | ||
|
||
!$omp parallel num_threads(2) default(none) firstprivate(ivar) | ||
print *, var(1) | ||
!$omp end parallel | ||
|
||
!$omp parallel num_threads(2) default(private) shared(ivar) | ||
print *, var(1) | ||
!$omp end parallel | ||
end subroutine test_cray_pointer_usage |