Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / resolve39.f90
blobb456b3ff93d0196a8551426e4f884af419f22b4f
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 subroutine s1
3 implicit none
4 real(8) :: x = 2.0
5 !ERROR: The associate name 'a' is already used in this associate statement
6 associate(a => x, b => x+1, a => x+2)
7 x = b
8 end associate
9 !ERROR: No explicit type declared for 'b'
10 x = b
11 end
13 subroutine s2
14 !ERROR: Associate name 'a' must have a type
15 associate (a => z'1')
16 end associate
17 end
19 subroutine s3
20 ! Test that associated entities are not preventing to fix
21 ! mis-parsed function references into array references
22 real :: a(10)
23 associate (b => a(2:10:2))
24 ! Check no complains about "Use of 'b' as a procedure"
25 print *, b(1) ! OK
26 end associate
27 associate (c => a(2:10:2))
28 ! Check the function reference has been fixed to an array reference
29 !ERROR: Reference to array 'c' with empty subscript list
30 print *, c()
31 end associate
32 end