Fix compilation failure with C++98 compilers
[official-gcc.git] / gcc / testsuite / gfortran.dg / min_max_optional_5.f90
blob583e766be4e853310ba4af4e5aa5f18616458f75
1 ! More tests for MIN/MAX with optional arguments
2 ! PR33095
4 ! { dg-do run }
5 if (m1(3,4) /= 4) STOP 1
6 if (m1(3) /= 3) STOP 2
7 if (m1() /= 2) STOP 3
9 if (m1(3,4) /= 4) STOP 4
10 if (m1(3) /= 3) STOP 5
11 contains
12 integer function m1(a1,a2)
13 integer, optional, intent(in) :: a1, a2
14 m1 = max(1, 2, a1, a2)
15 end function m1
17 integer function m2(a1,a2)
18 integer, optional, intent(in) :: a1, a2
19 m2 = max(1, a1, 2, a2)
20 end function m2
21 end