| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fcoarray=single -std=f2008" } |
| 3 |
! |
| 4 |
! PR fortran/18918 |
| 5 |
! |
| 6 |
! Diagnostic for atomic subroutines |
| 7 |
! |
| 8 |
use iso_fortran_env, only: atomic_int_kind, atomic_logical_kind |
| 9 |
implicit none |
| 10 |
integer(atomic_int_kind) :: a(1)[*] |
| 11 |
logical(1) :: c[*] |
| 12 |
integer(atomic_int_kind) :: b |
| 13 |
logical(atomic_logical_kind) :: d, e[*] |
| 14 |
|
| 15 |
call atomic_define(a, 7_2) ! { dg-error "must be a scalar" } |
| 16 |
call atomic_ref(b, b) ! { dg-error "shall be a coarray" } |
| 17 |
|
| 18 |
call atomic_define(c, 7) ! { dg-error "an integer of ATOMIC_INT_KIND or a logical of ATOMIC_LOGICAL_KIND" } |
| 19 |
call atomic_ref(d, a(1)) ! { dg-error "shall have the same type as 'atom'" } |
| 20 |
call atomic_ref(.true., e) ! { dg-error "shall be definable" } |
| 21 |
end |