Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / dosemantics04.f90
blob1409f6d323d3fdab7afde04c0aaa50da4056bf9f
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! C1123 -- Expressions in DO CONCURRENT header cannot reference variables
3 ! declared in the same header
4 PROGRAM dosemantics04
5 IMPLICIT NONE
6 INTEGER :: a, i, j, k, n
8 !ERROR: DO CONCURRENT mask expression references variable 'n' in LOCAL locality-spec
9 DO CONCURRENT (INTEGER *2 :: i = 1:10, i < j + n) LOCAL(n)
10 PRINT *, "hello"
11 END DO
13 !ERROR: DO CONCURRENT mask expression references variable 'a' in LOCAL locality-spec
14 DO 30 CONCURRENT (i = 1:n:1, j=1:n:2, k=1:n:3, a<3) LOCAL (a)
15 PRINT *, "hello"
16 30 END DO
18 ! Initial expression
19 !ERROR: DO CONCURRENT limit expression may not reference index variable 'j'
20 DO CONCURRENT (i = j:3, j=1:3)
21 END DO
23 ! Final expression
24 !ERROR: DO CONCURRENT limit expression may not reference index variable 'j'
25 DO CONCURRENT (i = 1:j, j=1:3)
26 END DO
28 ! Step expression
29 !ERROR: DO CONCURRENT step expression may not reference index variable 'j'
30 DO CONCURRENT (i = 1:3:j, j=1:3)
31 END DO
33 !ERROR: DO CONCURRENT limit expression may not reference index variable 'i'
34 DO CONCURRENT (INTEGER*2 :: i = 1:3, j=i:3)
35 END DO
37 END PROGRAM dosemantics04