2017-12-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / argument_checking_12.f90
blobdc5b5268ad600e9a46b758e293be5c60872cc8cc
1 ! { dg-do compile }
2 ! { dg-options "-std=f2003" }
4 ! PR fortran/34665
6 ! Test argument checking
8 implicit none
9 CONTAINS
10 SUBROUTINE test2(a,b,c,d,e)
11 character(len=*), dimension(:) :: a
12 character(len=*), pointer, dimension(:) :: b
13 character(len=*), dimension(*) :: c
14 character(len=*), dimension(5) :: d
15 character(len=*) :: e
17 call cas_size(e)
18 call cas_size("abc")
19 call cas_size(e//"a")
20 call cas_size(("abc"))
21 call cas_size(a(1))
22 call cas_size(b(1))
23 call cas_size((a(1)//"a"))
24 call cas_size((b(1)//"a"))
25 call cas_size((c(1)//"a"))
26 call cas_size((d(1)//"a"))
27 call cas_size(e(1:3))
28 call cas_size("abcd"(1:3))
29 call cas_size((e(1:3)))
30 call cas_size(("abcd"(1:3)//"a"))
31 call cas_size(e(1:3))
32 call cas_size("abcd"(1:3))
33 call cas_size((e(1:3)))
34 call cas_size(("abcd"(1:3)//"a"))
35 call cas_expl(e)
36 call cas_expl("abc")
37 call cas_expl(e//"a")
38 call cas_expl(("abc"))
39 call cas_expl(a(1))
40 call cas_expl(b(1))
41 call cas_expl((a(1)//"a"))
42 call cas_expl((b(1)//"a"))
43 call cas_expl((c(1)//"a"))
44 call cas_expl((d(1)//"a"))
45 call cas_expl(e(1:3))
46 call cas_expl("abcd"(1:3))
47 call cas_expl((e(1:3)))
48 call cas_expl(("abcd"(1:3)//"a"))
49 END SUBROUTINE test2
51 SUBROUTINE cas_size(a)
52 character(len=*), dimension(*) :: a
53 END SUBROUTINE cas_size
55 SUBROUTINE cas_expl(a)
56 character(len=*), dimension(5) :: a
57 END SUBROUTINE cas_expl
58 END