[LLVM] Fix Maintainers.md formatting (NFC)
[llvm-project.git] / flang / test / Semantics / implicit15.f90
blobd7cfa543e84a5157f7141e34633850ef78b969a3
1 !RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s
2 !Test inheritance of implicit rules in submodules and separate module
3 !procedures.
5 module m
6 implicit integer(1)(a-z)
7 interface
8 module subroutine mp(da) ! integer(2)
9 implicit integer(2)(a-z)
10 end
11 end interface
12 save :: mv ! integer(1)
13 end
15 submodule(m) sm1
16 implicit integer(8)(a-z)
17 save :: sm1v ! integer(8)
18 interface
19 module subroutine sm1p(da) ! default real
20 end
21 end interface
22 end
24 submodule(m:sm1) sm2
25 implicit integer(2)(a-c,e-z)
26 save :: sm2v ! integer(2)
27 contains
28 module subroutine sm1p(da) ! default real
29 save :: sm1pv ! inherited integer(2)
30 !CHECK: PRINT *, 1_4, 8_4, 2_4, 4_4, 2_4
31 print *, kind(mv), kind(sm1v), kind(sm2v), kind(da), kind(sm1pv)
32 end
33 end
35 submodule(m:sm2) sm3
36 implicit integer(8)(a-z)
37 save :: sm3v ! integer(8)
38 contains
39 module procedure mp
40 save :: mpv ! inherited integer(8)
41 call sm1p(1.)
42 !CHECK: PRINT *, 1_4, 8_4, 2_4, 8_4, 2_4, 8_4
43 print *, kind(mv), kind(sm1v), kind(sm2v), kind(sm3v), kind(da), kind(mpv)
44 end
45 end
47 program main
48 use m
49 call mp(1_2)
50 end