From 836fa030e6d051b4ea695a585e20f4b48370b06a Mon Sep 17 00:00:00 2001 From: fengwang Date: Tue, 15 Mar 2005 02:52:38 +0000 Subject: fortran/ 2005-03-15 Feng Wang PR fortran/18827 * io.c (resolve_tag): Add checking on assigned label. (match_dt_format): Does not set symbol assign attribute. * match.c (gfc_match_goto):Does not set symbol assign attribute. * resolve.c (resolve_code): Add checking on assigned label. * trans-common.c (build_field): Deals with common variable assigned a label. * trans-stmt.c (gfc_conv_label_variable): New function. (gfc_trans_label_assign): Use it. (gfc_trans_goto): Ditto. * trans-io.c (set_string): Ditto. * trans.h (gfc_conv_label_variable): Add prototype. testsuite/ 2005-03-15 Feng Wang PR fortran/18827 * gfortran.dg/assign_2.f90: New test. * gfortran.dg/assign_3.f90: New test. * gfortran.dg/assign.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96467 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/gfortran.dg/assign.f90 | 8 ++++++++ gcc/testsuite/gfortran.dg/assign_2.f90 | 11 +++++++++++ gcc/testsuite/gfortran.dg/assign_3.f90 | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/assign.f90 create mode 100644 gcc/testsuite/gfortran.dg/assign_2.f90 create mode 100644 gcc/testsuite/gfortran.dg/assign_3.f90 (limited to 'gcc/testsuite/gfortran.dg') diff --git a/gcc/testsuite/gfortran.dg/assign.f90 b/gcc/testsuite/gfortran.dg/assign.f90 new file mode 100644 index 00000000000..516a3d7632a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/assign.f90 @@ -0,0 +1,8 @@ +! { dg-do run } +! Program to test ASSIGNing a label to common variable. PR18827. + program test + integer i + common i + assign 2000 to i ! { dg-warning "Obsolete: ASSIGN statement" } +2000 continue + end diff --git a/gcc/testsuite/gfortran.dg/assign_2.f90 b/gcc/testsuite/gfortran.dg/assign_2.f90 new file mode 100644 index 00000000000..4119cd94f58 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/assign_2.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! Option passed to avoid excess errors from obsolete warning +! { dg-options "-w" } +! PR18827 + integer i,j + common /foo/ i,j + assign 1000 to j + j = 5 + goto j + 1000 continue + end diff --git a/gcc/testsuite/gfortran.dg/assign_3.f90 b/gcc/testsuite/gfortran.dg/assign_3.f90 new file mode 100644 index 00000000000..a43b10c11b1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/assign_3.f90 @@ -0,0 +1,11 @@ +! { dg-do compile } +! Option passed to avoid excess errors from obsolete warning +! { dg-options "-w" } +! PR18827 + integer i,j + equivalence (i,j) + assign 1000 to i + write (*, j) ! { dg-error "not been assigned a format label" } + goto j ! { dg-error "not been assigned a target label" } + 1000 continue + end -- cgit v1.2.1