-# Copyright 2016 Free Software Foundation, Inc.
+# Copyright 2016-2019 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
standard_testfile ".f90"
load_lib "fortran.exp"
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \
+if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \
{debug f90 quiet}] } {
return -1
}
# the debugger when accessing it.
gdb_breakpoint [gdb_get_line_number "before-allocated"]
gdb_continue_to_breakpoint "before-allocated"
-gdb_test "print twov" " = \\\( <not allocated>, <not allocated> \\\)" \
+gdb_test "print twov" " = \\\( ivla1 = <not allocated>, ivla2 = <not allocated> \\\)" \
"print twov before allocated"
gdb_test "print twov%ivla1" " = <not allocated>" \
"print twov%ivla1 before allocated"
gdb_test "print onev%ivla(3, 2, 1)" " = 321"
gdb_test "ptype onev" \
[multi_line "type = Type one" \
- "\\s+$int :: ivla\\\(11,22,33\\\)" \
+ "\\s+$int, allocatable :: ivla\\\(11,22,33\\\)" \
"End Type one" ]
# Check type with two VLA's inside
gdb_test "print twov%ivla1(3, 2, 1)" " = 321"
gdb_test "ptype twov" \
[multi_line "type = Type two" \
- "\\s+$int :: ivla1\\\(5,12,99\\\)" \
- "\\s+$int :: ivla2\\\(9,12\\\)" \
+ "\\s+$int, allocatable :: ivla1\\\(5,12,99\\\)" \
+ "\\s+$int, allocatable :: ivla2\\\(9,12\\\)" \
"End Type two" ]
-gdb_test "print twov" " = \\\( \\\(\\\( \\\( 1, 1, 1, 1, 1\\\)\
+gdb_test "print twov" " = \\\( ivla1 = \\\(\\\( \\\( 1, 1, 1, 1, 1\\\)\
\\\( 1, 1, 321, 1, 1\\\)\
\\\( 1, 1, 1, 1, 1\\\) .*"
gdb_test "ptype threev" \
[multi_line "type = Type three" \
"\\s+$int :: ivar" \
- "\\s+$int :: ivla\\\(20\\\)" \
+ "\\s+$int, allocatable :: ivla\\\(20\\\)" \
"End Type three" ]
# Check type with attribute at end of type
gdb_test "print fourv%ivar" " = 3"
gdb_test "ptype fourv" \
[multi_line "type = Type four" \
- "\\s+$int :: ivla\\\(10\\\)" \
+ "\\s+$int, allocatable :: ivla\\\(10\\\)" \
"\\s+$int :: ivar" \
"End Type four" ]
"End Type five" ]
gdb_test "ptype fivev%tone" \
[multi_line "type = Type one" \
- " $int :: ivla\\(10,10,10\\)" \
+ " $int, allocatable :: ivla\\(10,10,10\\)" \
"End Type one" ]
# Check array of types containing a VLA
"End Type five" ]
gdb_test "ptype fivearr(1)%tone" \
[multi_line "type = Type one" \
- " $int :: ivla\\(2,4,6\\)" \
+ " $int, allocatable :: ivla\\(2,4,6\\)" \
"End Type one" ]
gdb_test "ptype fivearr(2)" \
[multi_line "type = Type five" \
"End Type five" ]
gdb_test "ptype fivearr(2)%tone" \
[multi_line "type = Type one" \
- " $int :: ivla\\(12,14,16\\)" \
+ " $int, allocatable :: ivla\\(12,14,16\\)" \
"End Type one" ]
# Check allocation status of dynamic array and it's dynamic members
"ptype fivedynarr(2), tone is not allocated"
gdb_test "ptype fivedynarr(2)%tone" \
[multi_line "type = Type one" \
- " $int :: ivla\\(<not allocated>\\)" \
+ " $int, allocatable :: ivla\\(<not allocated>\\)" \
"End Type one" ] \
"ptype fivedynarr(2)%tone, not allocated"
"End Type five" ]
gdb_test "ptype fivedynarr(1)%tone" \
[multi_line "type = Type one" \
- " $int :: ivla\\(2,4,6\\)" \
+ " $int, allocatable :: ivla\\(2,4,6\\)" \
"End Type one" ]
gdb_test "ptype fivedynarr(2)" \
[multi_line "type = Type five" \
"End Type five" ]
gdb_test "ptype fivedynarr(2)%tone" \
[multi_line "type = Type one" \
- " $int :: ivla\\(12,14,16\\)" \
+ " $int, allocatable :: ivla\\(12,14,16\\)" \
"End Type one" ]