aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/deferred_character_12.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/deferred_character_12.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/deferred_character_12.f9037
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/deferred_character_12.f90 b/gcc/testsuite/gfortran.dg/deferred_character_12.f90
new file mode 100644
index 00000000000..cdb6c893756
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/deferred_character_12.f90
@@ -0,0 +1,37 @@
+! { dg-do run }
+!
+! Tests the fix for PR63232
+!
+! Contributed by Balint Aradi <baradi09@gmail.com>
+!
+module mymod
+ implicit none
+
+ type :: wrapper
+ character(:), allocatable :: string
+ end type wrapper
+
+contains
+
+
+ subroutine sub2(mystring)
+ character(:), allocatable, intent(out) :: mystring
+
+ mystring = "test"
+
+ end subroutine sub2
+
+end module mymod
+
+
+program test
+ use mymod
+ implicit none
+
+ type(wrapper) :: mywrapper
+
+ call sub2(mywrapper%string)
+ if (.not. allocated(mywrapper%string)) call abort
+ if (trim(mywrapper%string) .ne. "test") call abort
+
+end program test