[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Semantics / global01.f90
blobab3edf9ef805f4fd47b4b79110aeb5529d032a6d
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 ! Regression check: don't emit bogus "Implicit declaration of function 'global7' has a different result type than in previous declaration"
25 recursive function global6()
26 integer global6, z, n
27 entry global7(n) result(z)
28 if (n > 0) z = global7(n-1)
29 end function
31 program test
32 interface
33 !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))
34 subroutine global1(x)
35 real, intent(in) :: x
36 end subroutine
37 subroutine global2(x)
38 real, intent(in) :: x
39 end subroutine
40 subroutine global3(x) bind(c,name="abc")
41 real, intent(in) :: x
42 end subroutine
43 subroutine global4(x) ! not PURE, but that's ok
44 integer, intent(in) :: x
45 end subroutine
46 !WARNING: The global subprogram 'global5' is not compatible with its local procedure declaration (incompatible procedure attributes: Pure)
47 pure subroutine global5(x)
48 integer, intent(in) :: x
49 end subroutine
50 function global6()
51 integer global6
52 end function
53 function global7(n) result(z)
54 integer n, z
55 end function
56 end interface
57 end