1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C1121 -- any procedure referenced in a concurrent header must be pure
4 ! Also, check that the step expressions are not zero. This is prohibited by
5 ! Section 11.1.7.4.1, paragraph 1.
7 SUBROUTINE do_concurrent_c1121(i
,n
)
10 !ERROR: DO CONCURRENT mask expression may not reference impure procedure 'random'
11 DO CONCURRENT (i
= 1:n
, random() < 3)
16 IMPURE
FUNCTION random() RESULT(i
)
20 END SUBROUTINE do_concurrent_c1121
23 INTEGER, PARAMETER :: constInt
= 0
25 ! Warn on this one for backwards compatibility
26 !WARNING: DO step expression should not be zero
30 ! Warn on this one for backwards compatibility
31 !WARNING: DO step expression should not be zero
32 DO 20 I
= 1, 10, 5 - 5
35 ! Error, no compatibility requirement for DO CONCURRENT
36 !ERROR: DO CONCURRENT step expression may not be zero
37 DO CONCURRENT (I
= 1 : 10 : 0)
40 ! Error, this time with an integer constant
41 !ERROR: DO CONCURRENT step expression may not be zero
42 DO CONCURRENT (I
= 1 : 10 : constInt
)