Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / optstring_1.f90
blob58c397d1647a1ae0fe20154561af9645840b3523
1 ! Test optional character arguments. We still need to pass a string
2 ! length for the absent arguments
3 program optional_string_1
4 implicit none
6 call test(1, "test");
7 call test(2, c=42, b="Hello World")
8 contains
9 subroutine test(i, a, b, c)
10 integer :: i
11 character(len=4), optional :: a
12 character(len=*), optional :: b
13 integer, optional :: c
14 if (i .eq. 1) then
15 if (a .ne. "test") call abort
16 else
17 if (b .ne. "Hello World") call abort
18 if (c .ne. 42) call abort
19 end if
20 end subroutine
21 end program