aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.fortran/exprs.exp
diff options
context:
space:
mode:
authorWu Zhou <woodzltc@cn.ibm.com>2005-09-20 06:37:03 +0000
committerWu Zhou <woodzltc@cn.ibm.com>2005-09-20 06:37:03 +0000
commitca9295176c78c61895933517fcb2c73efa093a0a (patch)
tree483ce5ebaa95e7e30b1bfd8cc03cc69c3973afbd /gdb/testsuite/gdb.fortran/exprs.exp
parentc3e308a89cc880badddebbeecec0d240f2728b6d (diff)
downloadfsf-binutils-gdb-ca9295176c78c61895933517fcb2c73efa093a0a.zip
fsf-binutils-gdb-ca9295176c78c61895933517fcb2c73efa093a0a.tar.gz
fsf-binutils-gdb-ca9295176c78c61895933517fcb2c73efa093a0a.tar.bz2
* gdb.fortran/subarray.exp: New testcase to test the evaluation
of subarray and substring variable. * gdb.fortran/subarray.f: New source file for the test of subarray and substring variable evaluation. * gdb.fortran/exprs.exp: Add four tests for substring evaluation of string constant.
Diffstat (limited to 'gdb/testsuite/gdb.fortran/exprs.exp')
-rw-r--r--gdb/testsuite/gdb.fortran/exprs.exp9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp
index c970399..3f8d508 100644
--- a/gdb/testsuite/gdb.fortran/exprs.exp
+++ b/gdb/testsuite/gdb.fortran/exprs.exp
@@ -59,6 +59,13 @@ proc test_character_literals_accepted {} {
# Test various character values.
gdb_test "p 'a'" " = 'a'"
+
+ # Test various substring expression.
+ gdb_test "p 'abcdefg'(2:4)" " = 'bcd'"
+ gdb_test "p 'abcdefg'(:3)" " = 'abc'"
+ gdb_test "p 'abcdefg'(5:)" " = 'efg'"
+ gdb_test "p 'abcdefg'(:)" " = 'abcdefg'"
+
}
proc test_integer_literals_rejected {} {
@@ -248,8 +255,6 @@ proc test_arithmetic_expressions {} {
gdb_test "p 6.0 / 3" " = 2" "real divided by int"
gdb_test "p 6.0 / 3.0" " = 2" "real divided by real"
- # Test modulo with various operands
-
# Test exponentiation with various operands
gdb_test "p 2 ** 3" " = 8" "int powered by int"