summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/select_type_39.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/select_type_39.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_39.f0320
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/select_type_39.f03 b/gcc/testsuite/gfortran.dg/select_type_39.f03
new file mode 100644
index 00000000000..08d619536ab
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/select_type_39.f03
@@ -0,0 +1,20 @@
+! { dg-do run }
+!
+! Tests the fix for PR67564 comment #9.
+!
+! Contributed by Neil Carlson <neil.n.carlson@gmail.com>
+!
+class(*), allocatable :: val(:)
+call get_value (val)
+select type (val)
+type is (character(*))
+ if (size (val) .ne. 2) call abort
+ if (len(val) .ne. 3) call abort
+ if (any (val .ne. ['foo','bar'])) call abort
+end select
+contains
+ subroutine get_value (value)
+ class(*), allocatable, intent(out) :: value(:)
+ allocate(value, source=['foo','bar'])
+ end subroutine
+end