aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-10-31 14:30:48 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-10-31 14:30:48 +0000
commit69d10e15fb001b34aedfe14a7af7c9e1fafea6a0 (patch)
treeb6c163880ce8c9ea848f207995022ab68f0054b0 /gcc
parent26033479fb7d724061af07716f0077934032bbf9 (diff)
downloadgcc-69d10e15fb001b34aedfe14a7af7c9e1fafea6a0.zip
gcc-69d10e15fb001b34aedfe14a7af7c9e1fafea6a0.tar.gz
gcc-69d10e15fb001b34aedfe14a7af7c9e1fafea6a0.tar.bz2
re PR fortran/33162 (INTRINSIC functions as ACTUAL argument)
2007-10-31 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/33162 * gfortran.dg/interface_19.f90: New. * gfortran.dg/interface_20.f90: New. * gfortran.dg/interface_21.f90: New. From-SVN: r129799
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gfortran.dg/interface_19.f9029
-rw-r--r--gcc/testsuite/gfortran.dg/interface_20.f9020
-rw-r--r--gcc/testsuite/gfortran.dg/interface_21.f9022
4 files changed, 78 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 687dd19..b9307a1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/33162
+ * gfortran.dg/interface_19.f90: New.
+ * gfortran.dg/interface_20.f90: New.
+ * gfortran.dg/interface_21.f90: New.
+
2007-10-31 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/32377
diff --git a/gcc/testsuite/gfortran.dg/interface_19.f90 b/gcc/testsuite/gfortran.dg/interface_19.f90
new file mode 100644
index 0000000..2d72caa
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_19.f90
@@ -0,0 +1,29 @@
+! { dg-do run }
+! PR33162 INTRINSIC functions as ACTUAL argument
+! Test case adapted from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+module m
+implicit none
+contains
+ subroutine sub(a)
+ optional :: a
+ character(25) :: temp
+ interface
+ function a(x)
+ real(kind=8):: a
+ real(kind=8):: x
+ intent(in) :: x
+ end function a
+ end interface
+ if(present(a)) then
+ write(temp,'(f16.10)')a(4.0d0)
+ if (trim(temp) /= ' -0.6536436209') call abort
+ endif
+ end subroutine sub
+end module m
+
+use m
+implicit none
+intrinsic dcos
+call sub()
+call sub(dcos)
+end
diff --git a/gcc/testsuite/gfortran.dg/interface_20.f90 b/gcc/testsuite/gfortran.dg/interface_20.f90
new file mode 100644
index 0000000..2d7df47
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_20.f90
@@ -0,0 +1,20 @@
+! { dg-do compile }
+! PR33162 INTRINSIC functions as ACTUAL argument
+! Test case adapted from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+module m
+implicit none
+contains
+ subroutine sub(a)
+ interface
+ function a()
+ real :: a
+ end function a
+ end interface
+ print *, a()
+ end subroutine sub
+end module m
+use m
+implicit none
+intrinsic cos
+call sub(cos) ! { dg-error "Type/rank mismatch in argument" }
+end
diff --git a/gcc/testsuite/gfortran.dg/interface_21.f90 b/gcc/testsuite/gfortran.dg/interface_21.f90
new file mode 100644
index 0000000..fea6507
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_21.f90
@@ -0,0 +1,22 @@
+! { dg-do compile }
+! PR33162 INTRINSIC functions as ACTUAL argument
+! Test case adapted from PR by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+module m
+implicit none
+contains
+ subroutine sub(a)
+ interface
+ function a(x)
+ real :: a, x
+ intent(in) :: x
+ end function a
+ end interface
+ print *, a(4.0)
+ end subroutine sub
+end module m
+
+use m
+implicit none
+EXTERNAL foo ! implicit interface is undefined
+call sub(foo) ! { dg-error "Type/rank mismatch in argument" }
+end