| OLD | NEW |
| 1 # Copyright 1998-2000, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1998-2000, 2007-2012 Free Software Foundation, Inc. |
| 2 | 2 |
| 3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or |
| 6 # (at your option) any later version. | 6 # (at your option) any later version. |
| 7 # | 7 # |
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| 12 # | 12 # |
| 13 # You should have received a copy of the GNU General Public License | 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/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | 15 |
| 16 # This file was written by Elena Zannoni (ezannoni@cygnus.com) | 16 # This file was written by Elena Zannoni (ezannoni@cygnus.com) |
| 17 | 17 |
| 18 # This file is part of the gdb testsuite | 18 # This file is part of the gdb testsuite |
| 19 # | 19 # |
| 20 # tests for pointer arithmetic and pointer dereferencing | 20 # tests for pointer arithmetic and pointer dereferencing |
| 21 # with integer type variables and pointers to integers | 21 # with integer type variables and pointers to integers |
| 22 # | 22 # |
| 23 | 23 |
| 24 if $tracelevel then { | |
| 25 strace $tracelevel | |
| 26 } | |
| 27 | |
| 28 # | 24 # |
| 29 # test running programs | 25 # test running programs |
| 30 # | 26 # |
| 31 | 27 |
| 32 set testfile "pointers" | 28 set testfile "pointers" |
| 33 set srcfile ${testfile}.c | 29 set srcfile ${testfile}.c |
| 34 set binfile ${objdir}/${subdir}/${testfile} | 30 set binfile ${objdir}/${subdir}/${testfile} |
| 35 | 31 |
| 36 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { | 32 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { |
| 37 untested pointers.exp | 33 untested pointers.exp |
| 38 return -1 | 34 return -1 |
| 39 } | 35 } |
| 40 | 36 |
| 41 if [get_compiler_info ${binfile}] { | 37 if [get_compiler_info] { |
| 42 return -1; | 38 return -1; |
| 43 } | 39 } |
| 44 | 40 |
| 45 gdb_exit | 41 gdb_exit |
| 46 gdb_start | 42 gdb_start |
| 47 gdb_reinitialize_dir $srcdir/$subdir | 43 gdb_reinitialize_dir $srcdir/$subdir |
| 48 gdb_load ${binfile} | 44 gdb_load ${binfile} |
| 49 | 45 |
| 50 | 46 |
| 51 # | 47 # |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 274 |
| 279 gdb_test "ptype ppppC" "type = char \\*\\*\\*\\*" "ptype ppppC" | 275 gdb_test "ptype ppppC" "type = char \\*\\*\\*\\*" "ptype ppppC" |
| 280 | 276 |
| 281 gdb_test "ptype pppppC" "type = char \\*\\*\\*\\*\\*" "ptype pppppC" | 277 gdb_test "ptype pppppC" "type = char \\*\\*\\*\\*\\*" "ptype pppppC" |
| 282 | 278 |
| 283 gdb_test "ptype ppppppC" "type = char \\*\\*\\*\\*\\*\\*" "ptype ppppppC" | 279 gdb_test "ptype ppppppC" "type = char \\*\\*\\*\\*\\*\\*" "ptype ppppppC" |
| 284 | 280 |
| 285 # Regression test for a crash. | 281 # Regression test for a crash. |
| 286 | 282 |
| 287 gdb_test "p instance.array_variable + 0" \ | 283 gdb_test "p instance.array_variable + 0" \ |
| 288 " = \\(long (int )?\\*\\) 0x\[0-9a-f\]*" | 284 " = \\(long (int )?\\*\\) 0x\[0-9a-f\]* <instance>" |
| OLD | NEW |