aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2018-10-14 09:25:13 +0000
committerPaul Thomas <pault@gcc.gnu.org>2018-10-14 09:25:13 +0000
commit188a13e145ce17cb3a91abba7d5789d6d0d77a25 (patch)
treef05b9aad70db3d638809e0edab8dd4d4599cbdb8 /gcc
parent049f5ef927683b45b5d02a6dd7b1169c9138f12f (diff)
downloadgcc-188a13e145ce17cb3a91abba7d5789d6d0d77a25.zip
gcc-188a13e145ce17cb3a91abba7d5789d6d0d77a25.tar.gz
gcc-188a13e145ce17cb3a91abba7d5789d6d0d77a25.tar.bz2
re PR fortran/83146 (ICE on SELECT CASE statement with associate name)
2018-10-14 Paul Thomas <pault@gcc.gnu.org> PR fortran/83146 * gfortran.dg/associate_43.f90: New test. From-SVN: r265148
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/associate_43.f9035
2 files changed, 40 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f4c0284..ad5c0e1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-14 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/83146
+ * gfortran.dg/associate_43.f90: New test.
+
2018-10-14 Anthony Green <green@moxielogic.com>
* gcc.c-torture/execute/20101011-1.c: Adjust for moxie.
diff --git a/gcc/testsuite/gfortran.dg/associate_43.f90 b/gcc/testsuite/gfortran.dg/associate_43.f90
new file mode 100644
index 0000000..a1460ef
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/associate_43.f90
@@ -0,0 +1,35 @@
+! { dg-do run }
+!
+! Check that PR83146 remains fixed.
+!
+! Contributed by Neil Carlson <neil.n.carlson@gmail.com>
+!
+ type foo
+ integer n
+ end type
+ type bar
+ type(foo) array(2)
+ end type
+
+ type(bar) b
+ integer :: m=0
+
+ b%array(1)%n = 42
+ b%array(2)%n = 43
+
+ call assoc(1)
+ m = 1
+ call assoc(2)
+contains
+ subroutine assoc (n)
+ integer :: n
+ associate (n_array => b%array%n)
+ select case (n_array(n))
+ case (42)
+ if (m .ne. 0) stop 1
+ case default
+ if (m .eq. 0) stop 2
+ end select
+ end associate
+ end subroutine assoc
+end \ No newline at end of file