2007-06-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 01:21:29 +0000 (01:21 +0000)
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Jun 2007 01:21:29 +0000 (01:21 +0000)
PR testsuite/18923
* gfortran.dg/invalid_contains_1.f90: New test.
* gfortran.dg/invalid_contains_2.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125353 138bc75d-0d04-0410-961f-82ee72b054a4

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 58d3b77..3990087 100644 (file)
@@ -1,5 +1,11 @@
 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
        * gfortran.dg/secnds.f: Update test to avoid roundoff errors and
        midnight issues.
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" }