re PR fortran/18923 (segfault after subroutine name confusion)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 6 Jun 2007 01:21:29 +0000 (01:21 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 6 Jun 2007 01:21:29 +0000 (01:21 +0000)
2007-06-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR testsuite/18923
* gfortran.dg/invalid_contains_1.f90: New test.
* gfortran.dg/invalid_contains_2.f90: New test.

From-SVN: r125353

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/invalid_contains_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/invalid_contains_2.f90 [new file with mode: 0644]

index 58d3b77815679368def936b919d10e68400b8ab5..3990087283b7e02c30c3c0e7f33da7147e4f8c65 100644 (file)
@@ -1,3 +1,9 @@
+2007-06-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR testsuite/18923
+       * gfortran.dg/invalid_contains_1.f90: New test.
+       * gfortran.dg/invalid_contains_2.f90: New test.
+
 2007-06-05  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR testsuite/32057
diff --git a/gcc/testsuite/gfortran.dg/invalid_contains_1.f90 b/gcc/testsuite/gfortran.dg/invalid_contains_1.f90
new file mode 100644 (file)
index 0000000..757751d
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do compile } 
+! PR18923 segfault after subroutine name confusion.
+module FOO
+contains
+  subroutine FOO ! { dg-error "conflicts with PROCEDURE" }
+    character(len=selected_int_kind(0)) :: C ! { dg-error "data declaration statement" }
+  end subroutine ! { dg-error "Expecting END MODULE statement" }
+end ! { dg-warning "CONTAINS statement without FUNCTION" }
\ No newline at end of file
diff --git a/gcc/testsuite/gfortran.dg/invalid_contains_2.f90 b/gcc/testsuite/gfortran.dg/invalid_contains_2.f90
new file mode 100644 (file)
index 0000000..90be10f
--- /dev/null
@@ -0,0 +1,9 @@
+! { dg-do compile } 
+! PR18923 segfault after subroutine name confusion.
+program foo
+contains
+  subroutine foo(i) ! { dg-error "conflicts with PROCEDURE" }
+    integer :: i ! { dg-error "data declaration statement" }
+    character(len=selected_int_kind(i)) :: c ! { dg-error "data declaration statement" }
+  end subroutine ! { dg-error "Expecting END PROGRAM statement" }
+end program foo ! { dg-warning "CONTAINS statement without FUNCTION" }