| 1 |
! PR fortran/104328 |
| 2 |
! { dg-do compile } |
| 3 |
|
| 4 |
subroutine foo |
| 5 |
integer :: k = 1 |
| 6 |
!$omp atomic compare |
| 7 |
if ( k == 2 ) then ! { dg-error "unexpected !.OMP ATOMIC expression" } |
| 8 |
end if |
| 9 |
end |
| 10 |
subroutine bar |
| 11 |
real :: x = 1 |
| 12 |
!$omp atomic compare |
| 13 |
if ( x == 2 ) then ! { dg-error "unexpected !.OMP ATOMIC expression" } |
| 14 |
end if |
| 15 |
end |
| 16 |
subroutine baz |
| 17 |
integer :: i |
| 18 |
!$omp atomic capture |
| 19 |
i = 1 |
| 20 |
i = i + 1. ! { dg-error "!.OMP ATOMIC capture-statement requires a scalar variable of intrinsic type" } |
| 21 |
end |
| 22 |
subroutine qux |
| 23 |
integer :: i = 0 |
| 24 |
!$omp atomic capture |
| 25 |
i = i + 1.0 |
| 26 |
i = i + 1.0 ! { dg-error "!.OMP ATOMIC capture-statement requires a scalar variable of intrinsic type" } |
| 27 |
end |
| 28 |
subroutine garply |
| 29 |
logical :: k = .true. |
| 30 |
!$omp atomic capture compare |
| 31 |
if ( k ) then ! { dg-error "unexpected !.OMP ATOMIC expression" } |
| 32 |
else |
| 33 |
end if |
| 34 |
end |