aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran/vla-value.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.fortran/vla-value.exp')
-rw-r--r--gdb/testsuite/gdb.fortran/vla-value.exp27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp
index 3cf5d67..ed0cace 100644
--- a/gdb/testsuite/gdb.fortran/vla-value.exp
+++ b/gdb/testsuite/gdb.fortran/vla-value.exp
@@ -161,3 +161,30 @@ gdb_breakpoint [gdb_get_line_number "pvla-deassociated"]
gdb_continue_to_breakpoint "pvla-deassociated, second time"
gdb_test "print \$mypvar(1,3,8)" " = 1001" \
"print \$mypvar(1,3,8) after deallocated"
+
+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds-v1"]
+gdb_continue_to_breakpoint "vla1-neg-bounds-v1"
+with_test_prefix "negative bounds" {
+ gdb_test "print vla1(-2,-5,-3)" " = 1"
+ gdb_test "print vla1(-2,-3,-1)" " = -231"
+ gdb_test "print vla1(-3,-5,-3)" "no such vector element"
+ gdb_test "print vla1(-2,-6,-3)" "no such vector element"
+ gdb_test "print vla1(-2,-5,-4)" "no such vector element"
+ gdb_test "print vla1(0,-2,-1)" "no such vector element"
+ gdb_test "print vla1(-1,-1,-1)" "no such vector element"
+ gdb_test "print vla1(-1,-2,0)" "no such vector element"
+}
+
+gdb_breakpoint [gdb_get_line_number "vla1-neg-bounds-v2"]
+gdb_continue_to_breakpoint "vla1-neg-bounds-v2"
+with_test_prefix "negative lower bounds, positive upper bounds" {
+ gdb_test "print vla1(-2,-5,-3)" " = 2"
+ gdb_test "print vla1(-2,-3,-1)" " = 2"
+ gdb_test "print vla1(-2,-4,-2)" " = -242"
+ gdb_test "print vla1(-3,-5,-3)" "no such vector element"
+ gdb_test "print vla1(-2,-6,-3)" "no such vector element"
+ gdb_test "print vla1(-2,-5,-4)" "no such vector element"
+ gdb_test "print vla1(2,2,1)" "no such vector element"
+ gdb_test "print vla1(1,3,1)" "no such vector element"
+ gdb_test "print vla1(1,2,2)" "no such vector element"
+}