1# Copyright 2015-2019 Free Software Foundation, Inc. 2 3# This program is free software; you can redistribute it and/or modify 4# it under the terms of the GNU General Public License as published by 5# the Free Software Foundation; either version 3 of the License, or 6# (at your option) any later version. 7# 8# This program is distributed in the hope that it will be useful, 9# but WITHOUT ANY WARRANTY; without even the implied warranty of 10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11# GNU General Public License for more details. 12# 13# You should have received a copy of the GNU General Public License 14# along with this program. If not, see <http://www.gnu.org/licenses/>. 15 16standard_testfile "vla.f90" 17 18if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ 19 {debug f90 quiet}] } { 20 return -1 21} 22 23if ![runto_main] { 24 untested "could not run to main" 25 return -1 26} 27 28# Check the association status of various types of VLA's 29# and pointer to VLA's. 30gdb_breakpoint [gdb_get_line_number "vla1-allocated"] 31gdb_continue_to_breakpoint "vla1-allocated" 32gdb_test "print l" " = \\.TRUE\\." \ 33 "print vla1 allocation status (allocated)" 34 35gdb_breakpoint [gdb_get_line_number "vla2-allocated"] 36gdb_continue_to_breakpoint "vla2-allocated" 37gdb_test "print l" " = \\.TRUE\\." \ 38 "print vla2 allocation status (allocated)" 39 40gdb_breakpoint [gdb_get_line_number "pvla-associated"] 41gdb_continue_to_breakpoint "pvla-associated" 42gdb_test "print l" " = \\.TRUE\\." \ 43 "print pvla associated status (associated)" 44 45gdb_breakpoint [gdb_get_line_number "pvla-re-associated"] 46gdb_continue_to_breakpoint "pvla-re-associated" 47gdb_test "print l" " = \\.TRUE\\." \ 48 "print pvla associated status (re-associated)" 49 50gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] 51gdb_continue_to_breakpoint "pvla-deassociated" 52gdb_test "print l" " = \\.FALSE\\." \ 53 "print pvla allocation status (deassociated)" 54 55gdb_breakpoint [gdb_get_line_number "vla1-deallocated"] 56gdb_continue_to_breakpoint "vla1-deallocated" 57gdb_test "print l" " = \\.FALSE\\." \ 58 "print vla1 allocation status (deallocated)" 59gdb_test "print vla1" " = <not allocated>" \ 60 "print deallocated vla1" 61 62gdb_breakpoint [gdb_get_line_number "vla2-deallocated"] 63gdb_continue_to_breakpoint "vla2-deallocated" 64gdb_test "print l" " = \\.FALSE\\." "print vla2 deallocated" 65gdb_test "print vla2" " = <not allocated>" "print deallocated vla2" 66