Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / global01.f90
blob752c902c2c72135e1708a932117476d4c9ee218c
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -Werror
2 ! Catch discrepancies between a local interface and a global definition
4 subroutine global1(x)
5 integer, intent(in) :: x
6 end subroutine
8 subroutine global2(x) bind(c,name="xyz")
9 integer, intent(in) :: x
10 end subroutine
12 subroutine global3(x)
13 integer, intent(in) :: x
14 end subroutine
16 pure subroutine global4(x)
17 integer, intent(in) :: x
18 end subroutine
20 subroutine global5(x)
21 integer, intent(in) :: x
22 end subroutine
24 program test
25 interface
26 !WARNING: The global subprogram 'global1' is not compatible with its local procedure declaration (incompatible dummy argument #1: incompatible dummy data object types: INTEGER(4) vs REAL(4))
27 subroutine global1(x)
28 real, intent(in) :: x
29 end subroutine
30 subroutine global2(x)
31 real, intent(in) :: x
32 end subroutine
33 subroutine global3(x) bind(c,name="abc")
34 real, intent(in) :: x
35 end subroutine
36 subroutine global4(x) ! not PURE, but that's ok
37 integer, intent(in) :: x
38 end subroutine
39 !WARNING: The global subprogram 'global5' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure)
40 pure subroutine global5(x)
41 integer, intent(in) :: x
42 end subroutine
43 end interface
44 end