Blob Blame History Raw
Subject: [testsuite patch] Fortran: allocate()d memory is uninitialized

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline


  allocate (vla1 (5))         ! vla1-not-allocated
  l = allocated(vla1)         ! vla1-allocated     <------------------

Expecting: ^(510-data-evaluate-expression vla1[^M
]+)?(510\^done,value="\(0, 0, 0, 0, 0\)"[^M
]+[(]gdb[)] ^M
[ ]*)
510-data-evaluate-expression vla1^M
510^done,value="(1.82987403e-09, 7.8472714e-44, 1.82987403e-09, 7.8472714e-44, 2.67929926e+20)"^M
(gdb) ^M
FAIL: gdb.mi/mi-vla-fortran.exp: evaluate allocated vla


I think some older gfortran did initialize allocated memory but that is an
unspecified behavior.  I haven't found any initialization mentioned
in Fortran 90 standard (draft) and it is also clearly stated here:
	Initialization to 0 of allocated arrays (of integers) is an
	implementation issue. i.e. do not rely on it.

OK for check-in?


Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=1

2015-11-03  Jan Kratochvil  <>

	* gdb.mi/mi-vla-fortran.exp (evaluate allocated vla): Remove test.

diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
index d191623..baee7f8 100644
--- a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
+++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp
@@ -68,8 +68,6 @@ mi_create_breakpoint "-t vla.f90:$bp_lineno" 2 "del" "vla" ".*vla.f90" \
 mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \
   { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno"
-mi_gdb_test "510-data-evaluate-expression vla1" \
-  "510\\^done,value=\"\\(0, 0, 0, 0, 0\\)\"" "evaluate allocated vla"
 mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \
   "create local variable vla1_allocated"