Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gfortran.fortran-torture / execute / optstring_1.f90
blobbf68bfbf5b3c46116d6f92eac2e5a387cf29889d
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") STOP 1
16 else
17 if (b .ne. "Hello World") STOP 2
18 if (c .ne. 42) STOP 3
19 end if
20 end subroutine
21 end program