45 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! C1121 -- any procedure referenced in a concurrent header must be pure3 4! Also, check that the step expressions are not zero. This is prohibited by5! Section 11.1.7.4.1, paragraph 1.6 7SUBROUTINE do_concurrent_c1121(i,n)8 IMPLICIT NONE9 INTEGER :: i, n, flag10 !ERROR: DO CONCURRENT mask expression may not reference impure procedure 'random'11 DO CONCURRENT (i = 1:n, random() < 3)12 flag = 313 END DO14 15 CONTAINS16 IMPURE FUNCTION random() RESULT(i)17 INTEGER :: i18 i = 3519 END FUNCTION random20END SUBROUTINE do_concurrent_c112121 22SUBROUTINE s1()23 INTEGER, PARAMETER :: constInt = 024 25 ! Warn on this one for backwards compatibility26 !WARNING: DO step expression should not be zero [-Wzero-do-step]27 DO 10 I = 1, 10, 028 10 CONTINUE29 30 ! Warn on this one for backwards compatibility31 !WARNING: DO step expression should not be zero [-Wzero-do-step]32 DO 20 I = 1, 10, 5 - 533 20 CONTINUE34 35 ! Error, no compatibility requirement for DO CONCURRENT36 !ERROR: DO CONCURRENT step expression may not be zero37 DO CONCURRENT (I = 1 : 10 : 0)38 END DO39 40 ! Error, this time with an integer constant41 !ERROR: DO CONCURRENT step expression may not be zero42 DO CONCURRENT (I = 1 : 10 : constInt)43 END DO44end subroutine s145