Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / resolve05.f90
blob736babf07808a479caac3fbfa71feb770b87da21
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 program p
3 !PORTABILITY: Name 'p' declared in a main program should not have the same name as the main program
4 integer :: p
5 end
6 module m
7 !PORTABILITY: Name 'm' declared in a module should not have the same name as the module
8 integer :: m
9 end
10 submodule(m) sm
11 !PORTABILITY: Name 'sm' declared in a submodule should not have the same name as the submodule
12 integer :: sm
13 end
14 block data bd
15 !PORTABILITY: Name 'bd' declared in a BLOCK DATA subprogram should not have the same name as the BLOCK DATA subprogram
16 type bd
17 end type
18 end
19 module m2
20 type :: t
21 end type
22 interface
23 subroutine s
24 !ERROR: Module 'm2' cannot USE itself
25 use m2, only: t
26 end subroutine
27 end interface
28 end module
29 subroutine s
30 !ERROR: 's' is already declared in this scoping unit
31 integer :: s
32 end
33 function f() result(res)
34 integer :: res
35 !ERROR: 'f' is already declared in this scoping unit
36 !ERROR: The type of 'f' has already been declared
37 real :: f
38 res = 1
39 end