1! RUN: %python %S/test_modfile.py %s %flang_fc1 2! Verify miscellaneous bugs 3 4! The function result must be declared after the dummy arguments 5module m1 6contains 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 15end 16 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 29 30! Order of names in PUBLIC statement shouldn't affect .mod file. 31module m2 32 public :: a 33 type t 34 end type 35 type(t), parameter :: a = t() 36end 37 38!Expect: m2.mod 39!module m2 40! type::t 41! end type 42! type(t),parameter::a=t() 43!end 44 45module m3a 46 integer, parameter :: i4 = selected_int_kind(9) 47end 48module m3b 49 use m3a 50 integer(i4) :: j 51end 52 53!Expect: m3a.mod 54!module m3a 55! integer(4),parameter::i4=4_4 56! intrinsic::selected_int_kind 57!end 58 59!Expect: m3b.mod 60!module m3b 61! use m3a,only:i4 62! integer(4)::j 63!end 64 65! Test that character literals written with backslash escapes are read correctly. 66module m4a 67 character(1), parameter :: a = achar(1) 68end 69module m4b 70 use m4a 71 character(1), parameter :: b = a 72end 73 74!Expect: m4a.mod 75!module m4a 76! character(1_4,1),parameter::a="\001" 77! intrinsic::achar 78!end 79 80!Expect: m4b.mod 81!module m4b 82! use m4a,only:a 83! character(1_4,1),parameter::b="\001" 84!end 85 86