1255365Sdes! { dg-do compile } 2255365Sdes! { dg-options "-fcoarray=single -std=f2008" } 3255365Sdes! 4255365Sdes! PR fortran/18918 5255365Sdes! 6255365Sdes! Diagnostic for atomic subroutines 7255365Sdes! 8255365Sdesuse iso_fortran_env, only: atomic_int_kind, atomic_logical_kind 9255365Sdesimplicit none 10255365Sdesinteger(atomic_int_kind) :: a(1)[*] 11255365Sdeslogical(1) :: c[*] 12255365Sdesinteger(atomic_int_kind) :: b 13255365Sdeslogical(atomic_logical_kind) :: d, e[*] 14255365Sdes 15255365Sdescall atomic_define(a, 7_2) ! { dg-error "must be a scalar" } 16255365Sdescall atomic_ref(b, b) ! { dg-error "shall be a coarray" } 17255365Sdes 18255365Sdescall atomic_define(c, 7) ! { dg-error "an integer of ATOMIC_INT_KIND or a logical of ATOMIC_LOGICAL_KIND" } 19255365Sdescall atomic_ref(d, a(1)) ! { dg-error "shall have the same type as 'atom'" } 20255365Sdescall atomic_ref(.true., e) ! { dg-error "shall be definable" } 21255365Sdesend 22255365Sdes