[lldb] Fix "exact match" debug_names type queries (#118465)
[llvm-project.git] / flang / test / Semantics / call33.f90
blob285c4be98a9dbfe9fc294e9f88ae05f15f64a0a0
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -pedantic
2 module m
3 contains
4 subroutine s1(x)
5 character(3) :: x
6 end
7 subroutine s2(x)
8 character(3) :: x(1)
9 end
10 subroutine s3(x)
11 character(3) :: x(:)
12 end
13 subroutine s4(x)
14 character(3) :: x(..)
15 end
16 subroutine s5(x)
17 character(3), allocatable :: x
18 end
19 subroutine s6(x)
20 character(3), pointer :: x
21 end
22 end
24 program test
25 use m
26 character(2) short, shortarr(1)
27 character(2), allocatable :: shortalloc
28 character(2), pointer :: shortptr
29 character(4) long, longarr(1)
30 character(4), allocatable :: longalloc
31 character(4), pointer :: longptr
32 !WARNING: Actual argument variable length '2' is less than expected length '3'
33 call s1(short)
34 !ERROR: Actual argument array has fewer characters (2) than dummy argument 'x=' array (3)
35 call s2(shortarr)
36 !ERROR: Actual argument variable length '2' does not match the expected length '3'
37 call s3(shortarr)
38 !ERROR: Actual argument variable length '2' does not match the expected length '3'
39 call s4(shortarr)
40 !ERROR: Actual argument variable length '2' does not match the expected length '3'
41 call s5(shortalloc)
42 !ERROR: Actual argument variable length '2' does not match the expected length '3'
43 !ERROR: Target type CHARACTER(KIND=1,LEN=2_8) is not compatible with pointer type CHARACTER(KIND=1,LEN=3_8)
44 call s6(shortptr)
45 call s1(long) ! ok
46 call s2(longarr) ! ok
47 !ERROR: Actual argument variable length '4' does not match the expected length '3'
48 call s3(longarr)
49 !ERROR: Actual argument variable length '4' does not match the expected length '3'
50 call s4(longarr)
51 !ERROR: Actual argument variable length '4' does not match the expected length '3'
52 call s5(longalloc)
53 !ERROR: Actual argument variable length '4' does not match the expected length '3'
54 !ERROR: Target type CHARACTER(KIND=1,LEN=4_8) is not compatible with pointer type CHARACTER(KIND=1,LEN=3_8)
55 call s6(longptr)
56 end