summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorfengwang <fengwang@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 02:52:38 +0000
committerfengwang <fengwang@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-15 02:52:38 +0000
commit836fa030e6d051b4ea695a585e20f4b48370b06a (patch)
tree9d626c10efe2ea1ff72bf8bd94fa123c776b3dad /gcc/testsuite/gfortran.dg
parente32bc24c11467027ae1bd3e66302f7b23bb112db (diff)
downloadgcc-836fa030e6d051b4ea695a585e20f4b48370b06a.tar.gz
fortran/
2005-03-15 Feng Wang <fengwang@nudt.edu.cn> 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 <fengwang@nudt.edu.cn> 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
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/assign.f908
-rw-r--r--gcc/testsuite/gfortran.dg/assign_2.f9011
-rw-r--r--gcc/testsuite/gfortran.dg/assign_3.f9011
3 files changed, 30 insertions, 0 deletions
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