aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2009-03-28 17:08:25 +0000
committerPaul Thomas <pault@gcc.gnu.org>2009-03-28 17:08:25 +0000
commit5d63a35f9f1a1ec0171ae9003fba40ddc60d8f51 (patch)
tree9f45ffa189df27ff2584390980d827f3a38d280a /gcc/testsuite
parent6b02d5f75384dde3f9aa29817a806b797d86e377 (diff)
downloadgcc-5d63a35f9f1a1ec0171ae9003fba40ddc60d8f51.zip
gcc-5d63a35f9f1a1ec0171ae9003fba40ddc60d8f51.tar.gz
gcc-5d63a35f9f1a1ec0171ae9003fba40ddc60d8f51.tar.bz2
re PR fortran/36703 (ICE (segfault) in reduce_binary0 (arith.c:1778))
2009-02-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/36703 PR fortran/36528 * trans-expr.c (gfc_conv_function_val): Stabilize Cray-pointer function references to ensure that a valid expression is used. (gfc_conv_function_call): Pass Cray pointers to procedures. 2009-02-13 Paul Thomas <pault@gcc.gnu.org> PR fortran/36528 * gfortran.dg/cray_pointers_8.f90: New test. PR fortran/36703 * gfortran.dg/cray_pointers_9.f90: New test. From-SVN: r145196
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/char_result_13.f9049
2 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c5018d7..961d0d6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-03-28 Paul Thomas <pault@gcc.gnu.org
+
+ PR fortran/38538
+ * gfortran.dg/char_result_13.f90: New test.
+
2009-03-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/38765
diff --git a/gcc/testsuite/gfortran.dg/char_result_13.f90 b/gcc/testsuite/gfortran.dg/char_result_13.f90
new file mode 100644
index 0000000..741d55f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/char_result_13.f90
@@ -0,0 +1,49 @@
+! { dg-do run }
+! Tests the fix for PR38538, where the character length for the
+! argument of 'func' was not calculated.
+!
+! Contributed by Vivek Rao <vivekrao4@yahoo.com>
+!
+module abc
+ implicit none
+contains
+ subroutine xmain (i, j)
+ integer i, j
+ call foo (func ("_"//bar (i)//"x"//bar (j)//"x"), "_abcxabx") ! original was elemental
+ call foo (nfunc("_"//bar (j)//"x"//bar (i)//"x"), "_abxabcx")
+ end subroutine xmain
+!
+ function bar (i) result(yy)
+ integer i, j, k
+ character (len = i) :: yy(2)
+ do j = 1, size (yy, 1)
+ do k = 1, i
+ yy(j)(k:k) = char (96+k)
+ end do
+ end do
+ end function bar
+!
+ elemental function func (yy) result(xy)
+ character (len = *), intent(in) :: yy
+ character (len = len (yy)) :: xy
+ xy = yy
+ end function func
+!
+ function nfunc (yy) result(xy)
+ character (len = *), intent(in) :: yy(:)
+ character (len = len (yy)) :: xy(size (yy))
+ xy = yy
+ end function nfunc
+!
+ subroutine foo(cc, teststr)
+ character (len=*), intent(in) :: cc(:)
+ character (len=*), intent(in) :: teststr
+ if (any (cc .ne. teststr)) call abort
+ end subroutine foo
+end module abc
+
+ use abc
+ call xmain(3, 2)
+end
+! { dg-final { cleanup-modules "abc" } }
+