[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / call19.f90
blob753ff95d280df533eaaf558a9058076aa3c9e859
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Ensures that things that aren't procedures aren't allowed to be called.
3 module m
4 integer :: i
5 integer, pointer :: ip
6 type :: t
7 end type
8 type :: pdt(k,len)
9 integer, kind :: k
10 integer, len :: len
11 end type
12 type(pdt(1,2)) :: x
13 namelist /nml/i
14 contains
15 subroutine s(d)
16 real d
17 !ERROR: 'm' is not a callable procedure
18 call m
19 !ERROR: Cannot call function 'i' like a subroutine
20 call i
21 !ERROR: Cannot call function 'ip' like a subroutine
22 call ip
23 !ERROR: 't' is not a callable procedure
24 call t
25 !ERROR: 'k' is not a procedure
26 call x%k
27 !ERROR: 'len' is not a procedure
28 call x%len
29 !ERROR: Use of 'nml' as a procedure conflicts with its declaration
30 call nml
31 !ERROR: Cannot call function 'd' like a subroutine
32 call d
33 end subroutine
34 end