Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / modfile30.f90
blob9c3fffb15f7cfbb5ba41027cbd08820aa66f4a99
1 ! RUN: %python %S/test_modfile.py %s %flang_fc1
2 ! Verify miscellaneous bugs
4 ! The function result must be declared after the dummy arguments
5 module m1
6 contains
7 function f1(x) result(y)
8 integer :: x(:)
9 integer :: y(size(x))
10 end
11 function f2(x)
12 integer :: x(:)
13 integer :: f2(size(x))
14 end
15 end
17 !Expect: m1.mod
18 !module m1
19 !contains
20 ! function f1(x) result(y)
21 ! integer(4)::x(:)
22 ! integer(4)::y(1_8:size(x,dim=1,kind=8))
23 ! end
24 ! function f2(x)
25 ! integer(4)::x(:)
26 ! integer(4)::f2(1_8:size(x,dim=1,kind=8))
27 ! end
28 !end
30 ! Order of names in PUBLIC statement shouldn't affect .mod file.
31 module m2
32 public :: a
33 type t
34 end type
35 type(t), parameter :: a = t()
36 end
38 !Expect: m2.mod
39 !module m2
40 ! type::t
41 ! end type
42 ! type(t),parameter::a=t()
43 !end
45 module m3a
46 integer, parameter :: i4 = selected_int_kind(9)
47 end
48 module m3b
49 use m3a
50 integer(i4) :: j
51 end
53 !Expect: m3a.mod
54 !module m3a
55 ! integer(4),parameter::i4=4_4
56 ! intrinsic::selected_int_kind
57 !end
59 !Expect: m3b.mod
60 !module m3b
61 ! use m3a,only:i4
62 ! integer(4)::j
63 !end
65 ! Test that character literals written with backslash escapes are read correctly.
66 module m4a
67 character(1), parameter :: a = achar(1)
68 end
69 module m4b
70 use m4a
71 character(1), parameter :: b = a
72 end
74 !Expect: m4a.mod
75 !module m4a
76 ! character(1_4,1),parameter::a="\001"
77 ! intrinsic::achar
78 !end
80 !Expect: m4b.mod
81 !module m4b
82 ! use m4a,only:a
83 ! character(1_4,1),parameter::b="\001"
84 !end