54 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! %VAL en %REF legacy extension semantic tests.3 4subroutine val_errors(array, string, polymorphic, derived)5 type t6 integer :: t7 end type8 integer :: array(10)9 character(*) :: string10 type(t) :: derived11 type(*) :: polymorphic12 interface13 subroutine foo5(a)14 integer a(:)15 end16 end interface17 !ERROR: %VAL argument must be a scalar numeric or logical expression18 call foo1(%val(array))19 !ERROR: %VAL argument must be a scalar numeric or logical expression20 call foo2(%val(string))21 !ERROR: %VAL argument must be a scalar numeric or logical expression22 call foo3(%val(derived))23 !ERROR: Assumed type actual argument requires an explicit interface24 !ERROR: %VAL argument must be a scalar numeric or logical expression25 call foo4(%val(polymorphic))26 !ERROR: %VAL or %REF are not allowed for dummy argument 'a=' that must be passed by means of a descriptor27 call foo5(%ref(array))28end subroutine29 30subroutine val_ok()31 integer :: array(10)32 real :: x33 logical :: l34 complex :: c35 call ok1(%val(array(1)))36 call ok2(%val(x))37 call ok3(%val(l))38 call ok4(%val(c))39 call ok5(%val(42))40 call ok6(%val(x+x))41end subroutine42 43subroutine ref_ok(array, string, derived)44 type t45 integer :: t46 end type47 integer :: array(10)48 character(*) :: string49 type(t) :: derived50 call rok1(%ref(array))51 call rok2(%ref(string))52 call rok3(%ref(derived))53end subroutine54