diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2012-09-25 12:20:42 +0000 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2012-09-25 12:20:42 +0000 |
commit | 318102b961ee0819c326894f988b187c11b24285 (patch) | |
tree | 4dc9fe46ff860308e61fd9c76b557e8e3423fb30 /gdb/testsuite | |
parent | ec4dbad32d15acd95084aea6145486dac5a19948 (diff) | |
download | gdb-318102b961ee0819c326894f988b187c11b24285.zip gdb-318102b961ee0819c326894f988b187c11b24285.tar.gz gdb-318102b961ee0819c326894f988b187c11b24285.tar.bz2 |
gdb/ChangeLog:
* c-typeprint.c (c_type_print_varspec_suffix): Remove cast and
use plongest to print the array size.
testsuite/ChangeLog:
* gdb.base/longest-types.c: New test case.
* gdb.base/longest-types.exp: New test case.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/longest-types.c | 28 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/longest-types.exp | 25 |
3 files changed, 58 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index da01f8d..5e2bc5f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-09-25 Siddhesh Poyarekar <siddhesh@redhat.com> + + * gdb.base/longest-types.c: New test case. + * gdb.base/longest-types.exp: New test case. + 2012-09-25 Yao Qi <yao@codesourcery.com> * gdb.mi/mi2-cli.exp: Check breakpoint notification. diff --git a/gdb/testsuite/gdb.base/longest-types.c b/gdb/testsuite/gdb.base/longest-types.c new file mode 100644 index 0000000..1394c08 --- /dev/null +++ b/gdb/testsuite/gdb.base/longest-types.c @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2012 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +struct foo +{ + char buf[0xffff000000]; + char buf2[2]; +} *f; + +int +main (void) +{ + return 0; +} diff --git a/gdb/testsuite/gdb.base/longest-types.exp b/gdb/testsuite/gdb.base/longest-types.exp new file mode 100644 index 0000000..334307a --- /dev/null +++ b/gdb/testsuite/gdb.base/longest-types.exp @@ -0,0 +1,25 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2012 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 +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +standard_testfile + +if { [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug quiet}] } { + return -1 +} + +# 64-bit array size should not overflow +gdb_test "print &f->buf" {= \(char \(\*\)\[1099494850560\]\) 0x0} |