aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/interface_59.f9015
-rw-r--r--gcc/testsuite/gfortran.dg/pr119502.f9015
2 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/interface_59.f90 b/gcc/testsuite/gfortran.dg/interface_59.f90
new file mode 100644
index 0000000..c9ccd67
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_59.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! PR fortran/119669 - this used to generate an ICE.
+
+program a
+ implicit real(a-h,o-z)
+ external abstract_caller, caller, func
+! real func
+ call abstract_caller (caller, func, 1.5)
+ call abstract_caller (caller, func, 1.5)
+end program a
+
+function func (x)
+ real func, x
+ func = x * x - 1.
+end
diff --git a/gcc/testsuite/gfortran.dg/pr119502.f90 b/gcc/testsuite/gfortran.dg/pr119502.f90
new file mode 100644
index 0000000..80d7c61
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr119502.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+
+! PR119502, negative unit numbers are not allowed without using NEWUNIT
+
+program foo
+ integer :: iun = -1
+ integer :: ios
+ open (iun, iostat=ios)
+ if (ios == 0) stop 1
+ write(iun,*, iostat=ios) "This is a test."
+ if (ios == 0) stop 2
+ close (iun, iostat=ios)
+ if (ios == 0) stop 3
+end
+