[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / modfile01.f90
blobfcbc00a09828489bb595d705e30edbbd25c51cda
1 ! RUN: %python %S/test_modfile.py %s %flang_fc1
2 ! Check correct modfile generation for type with private component.
3 module m
4 integer :: i
5 integer, private :: j
6 type :: t
7 integer :: i
8 integer, private :: j
9 end type
10 type, private :: u
11 end type
12 type(t) :: x
13 end
15 !Expect: m.mod
16 !module m
17 !integer(4)::i
18 !integer(4),private::j
19 !type::t
20 !integer(4)::i
21 !integer(4),private::j
22 !end type
23 !type,private::u
24 !end type
25 !type(t)::x
26 !end
28 ! Check correct modfile generation for type with private module procedure.
30 module m2
31 private :: s1
32 contains
33 subroutine s1()
34 end
35 subroutine s2()
36 end
37 end
39 !Expect: m2.mod
40 !module m2
41 ! private::s1
42 !contains
43 ! subroutine s1()
44 ! end
45 ! subroutine s2()
46 ! end
47 !end
49 module m3
50 private
51 public :: f1
52 contains
53 real function f1()
54 end
55 real function f2()
56 end
57 end
59 !Expect: m3.mod
60 !module m3
61 ! private::f2
62 !contains
63 ! function f1()
64 ! real(4)::f1
65 ! end
66 ! function f2()
67 ! real(4)::f2
68 ! end
69 !end
71 ! Test optional dummy procedure
72 module m4
73 contains
74 subroutine s(f)
75 interface
76 logical recursive function f()
77 implicit none
78 end function
79 end interface
80 optional f
81 end
82 end
84 !Expect: m4.mod
85 !module m4
86 !contains
87 ! subroutine s(f)
88 ! optional::f
89 ! interface
90 ! recursive function f()
91 ! logical(4)::f
92 ! end
93 ! end interface
94 ! end
95 !end