-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang][OpenMP] Fix for error in atomic read for different elements o…
- Loading branch information
1 parent
cca3217
commit 2a005bf
Showing
2 changed files
with
58 additions
and
3 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
41 changes: 41 additions & 0 deletions
41
flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt-read.f90
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,41 @@ | ||
! RUN: %flang_fc1 -fopenmp %s -o - | ||
|
||
integer :: x, vv(2), xx(2) | ||
type t1 | ||
integer :: v,y,yy(2) | ||
end type t1 | ||
type(t1)::t,tt(2) | ||
x=1 | ||
xx=1 | ||
vv=1 | ||
t%y=1 | ||
t%yy=1 | ||
tt(1)%y=1 | ||
tt(1)%yy=1 | ||
tt(2)%v=1 | ||
tt(2)%y=1 | ||
tt(2)%yy=1 | ||
|
||
!$omp atomic read | ||
vv(1) = vv(2) | ||
!$omp atomic read | ||
t%v = t%y | ||
!$omp atomic read | ||
t%v = t%yy(1) | ||
!$omp atomic read | ||
tt(1)%v = tt(1)%y | ||
!$omp atomic read | ||
tt(1)%v = tt(2)%v | ||
!$omp atomic read | ||
tt(1)%v = tt(1)%yy(1) | ||
!$omp atomic read | ||
t%yy(2) = t%y | ||
!$omp atomic read | ||
t%yy(2) = t%yy(1) | ||
!$omp atomic read | ||
tt(1)%yy(2) = tt(1)%y | ||
!$omp atomic read | ||
tt(1)%yy(2) = tt(1)%yy(1) | ||
!$omp atomic read | ||
tt(1)%yy(2) = tt(2)%yy(2) | ||
end |