brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 1b70291 Raw
51 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! Test 15.5.2.8 coarray dummy arguments3 4module m5 6  real :: c1[*]7  real, volatile :: c2[*]8 9 contains10 11  subroutine s01(x)12    real :: x[*]13  end subroutine14  subroutine s02(x)15    real, volatile :: x[*]16  end subroutine17  subroutine s03(x)18    real, contiguous :: x(:)[*]19  end subroutine20  subroutine s04(x)21    real :: x(*)[*]22  end subroutine23 24  subroutine test(x,c3,c4)25    real :: scalar26    real :: x(:)[*]27    real, intent(in) :: c3(:)[*]28    real, contiguous, intent(in) :: c4(:)[*]29    character(2) :: coarr(2)[*] = [ "ab", "cd" ]30    call s01(c1) ! ok31    call s02(c2) ! ok32    call s03(c4) ! ok33    call s04(c4) ! ok34    !ERROR: Actual argument associated with coarray dummy argument 'x=' must be a coarray35    call s01(scalar)36    !ERROR: VOLATILE coarray may not be associated with non-VOLATILE coarray dummy argument 'x='37    call s01(c2)38    !ERROR: non-VOLATILE coarray may not be associated with VOLATILE coarray dummy argument 'x='39    call s02(c1)40    !ERROR: Actual argument associated with a CONTIGUOUS coarray dummy argument 'x=' must be simply contiguous41    call s03(c3)42    !ERROR: Actual argument associated with a CONTIGUOUS coarray dummy argument 'x=' must be simply contiguous43    call s03(x)44    !ERROR: Actual argument associated with coarray dummy argument 'x=' (not assumed shape or rank) must be simply contiguous45    call s04(c3)46    !ERROR: Actual argument associated with coarray dummy argument 'x=' (not assumed shape or rank) must be simply contiguous47    call s04(x)48    print *, ichar(coarr(:)(1:1)) ! ok, ensure no bogus contiguity error49  end subroutine50end module51