"\\s+$int :: ivla\\\(10,10,10\\\)" \
"\\s+End Type one :: tone" \
"End Type five" ]
+
+# Check array of types containing a VLA
+gdb_breakpoint [gdb_get_line_number "fivearr-filled"]
+gdb_continue_to_breakpoint "fivearr-filled"
+gdb_test "print fivearr(1)%tone%ivla(1, 2, 3)" " = 1"
+gdb_test "print fivearr(1)%tone%ivla(2, 2, 10)" "no such vector element"
+gdb_test "print fivearr(1)%tone%ivla(2, 2, 3)" " = 223"
+gdb_test "print fivearr(2)%tone%ivla(12, 14, 16)" " = 2"
+gdb_test "print fivearr(2)%tone%ivla(6, 7, 8)" " = 678"
+gdb_test "ptype fivearr(1)" \
+ [multi_line "type = Type five" \
+ "\\s+Type one" \
+ "\\s+$int :: ivla\\\(2,4,6\\\)" \
+ "\\s+End Type one :: tone" \
+ "End Type five" ]
+gdb_test "ptype fivearr(2)" \
+ [multi_line "type = Type five" \
+ "\\s+Type one" \
+ "\\s+$int :: ivla\\\(12,14,16\\\)" \
+ "\\s+End Type one :: tone" \
+ "End Type five" ]
+
+# Check allocation status of dynamic array and it's dynamic members
+gdb_test "ptype fivedynarr" "type = <not allocated>"
+gdb_test "next" ""
+gdb_test "ptype fivedynarr(2)" \
+ [multi_line "type = Type five" \
+ "\\s+Type one" \
+ "\\s+$int :: ivla\\\(<not allocated>\\\)" \
+ "\\s+End Type one :: tone" \
+ "End Type five" ]
+
+# Check dynamic array of types containing a VLA
+gdb_breakpoint [gdb_get_line_number "fivedynarr-filled"]
+gdb_continue_to_breakpoint "fivedynarr-filled"
+gdb_test "print fivedynarr(1)%tone%ivla(1, 2, 3)" " = 1"
+gdb_test "print fivedynarr(1)%tone%ivla(2, 2, 10)" "no such vector element"
+gdb_test "print fivedynarr(1)%tone%ivla(2, 2, 3)" " = 223"
+gdb_test "print fivedynarr(2)%tone%ivla(12, 14, 16)" " = 2"
+gdb_test "print fivedynarr(2)%tone%ivla(6, 7, 8)" " = 678"
+gdb_test "ptype fivedynarr(1)" \
+ [multi_line "type = Type five" \
+ "\\s+Type one" \
+ "\\s+$int :: ivla\\\(2,4,6\\\)" \
+ "\\s+End Type one :: tone" \
+ "End Type five" ]
+gdb_test "ptype fivedynarr(2)" \
+ [multi_line "type = Type five" \
+ "\\s+Type one" \
+ "\\s+$int :: ivla\\\(12,14,16\\\)" \
+ "\\s+End Type one :: tone" \
+ "End Type five" ]
type(three) :: threev
type(four) :: fourv
type(five) :: fivev
+ type(five) :: fivearr (2)
+ type(five), allocatable :: fivedynarr (:)
logical :: l
integer :: i, j
fivev%tone%ivla(1, 2, 3) = 123
fivev%tone%ivla(3, 2, 1) = 321
- ! dummy statement for bp
- l = allocated(fivev%tone%ivla) ! fivev-filled
+ allocate (fivearr(1)%tone%ivla (2, 4, 6)) ! fivev-filled
+ allocate (fivearr(2)%tone%ivla (12, 14, 16))
+ fivearr(1)%tone%ivla(:, :, :) = 1
+ fivearr(1)%tone%ivla(2, 2, 3) = 223
+ fivearr(2)%tone%ivla(:, :, :) = 2
+ fivearr(2)%tone%ivla(6, 7, 8) = 678
+
+ allocate (fivedynarr(2)) ! fivearr-filled
+ allocate (fivedynarr(1)%tone%ivla (2, 4, 6))
+ allocate (fivedynarr(2)%tone%ivla (12, 14, 16))
+ fivedynarr(1)%tone%ivla(:, :, :) = 1
+ fivedynarr(1)%tone%ivla(2, 2, 3) = 223
+ fivedynarr(2)%tone%ivla(:, :, :) = 2
+ fivedynarr(2)%tone%ivla(6, 7, 8) = 678
+
+ l = allocated(fivedynarr) ! fivedynarr-filled
end program vla_struct