summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/min_max_optional_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/min_max_optional_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/min_max_optional_1.f9020
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/min_max_optional_1.f90 b/gcc/testsuite/gfortran.dg/min_max_optional_1.f90
new file mode 100644
index 000000000..250010dff
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/min_max_optional_1.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+IF (T1(1.0,1.0) .NE. (1.0,1.0) ) CALL ABORT()
+IF (T1(1.0) .NE. (1.0,0.0)) CALL ABORT()
+IF (M1(1,2,3) .NE. 3) CALL ABORT()
+IF (M1(1,2,A4=4) .NE. 4) CALL ABORT()
+CONTAINS
+
+COMPLEX FUNCTION T1(X,Y)
+ REAL :: X
+ REAL, OPTIONAL :: Y
+ T1=CMPLX(X,Y)
+END FUNCTION T1
+
+INTEGER FUNCTION M1(A1,A2,A3,A4)
+ INTEGER :: A1,A2
+ INTEGER, OPTIONAL :: A3,A4
+ M1=MAX(A1,A2,A3,A4)
+END FUNCTION M1
+
+END