| OLD | NEW |
| 1 # Copyright 1998-2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 1998-2004, 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 tests command line calls with functions returning structures | 18 # this file tests command line calls with functions returning structures |
| 19 # corresponding source file: call_return_struct.c | 19 # corresponding source file: call_return_struct.c |
| 20 | 20 |
| 21 | 21 |
| 22 | 22 |
| 23 if $tracelevel then { | |
| 24 strace $tracelevel | |
| 25 } | |
| 26 | |
| 27 | 23 |
| 28 set testfile "call-rt-st" | 24 set testfile "call-rt-st" |
| 29 set srcfile ${testfile}.c | 25 set srcfile ${testfile}.c |
| 30 set binfile ${objdir}/${subdir}/${testfile} | 26 set binfile ${objdir}/${subdir}/${testfile} |
| 31 | 27 |
| 32 | 28 |
| 33 # Test depends on printf, which the sparclet stub doesn't support. | 29 # Test depends on printf, which the sparclet stub doesn't support. |
| 34 if { [istarget "sparclet-*-*"] } { | 30 if { [istarget "sparclet-*-*"] } { |
| 35 return 0; | 31 return 0; |
| 36 } | 32 } |
| 37 | 33 |
| 38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { | 34 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { |
| 39 untested "couldn't compile ${srcdir}/${subdir}/${srcfile}" | 35 untested "couldn't compile ${srcdir}/${subdir}/${srcfile}" |
| 40 return -1 | 36 return -1 |
| 41 } | 37 } |
| 42 | 38 |
| 43 | 39 |
| 44 | 40 |
| 45 # Create and source the file that provides information about the compiler | 41 # Create and source the file that provides information about the compiler |
| 46 # used to compile the test case. | 42 # used to compile the test case. |
| 47 | 43 |
| 48 if [get_compiler_info ${binfile}] { | 44 if [get_compiler_info] { |
| 49 return -1; | 45 return -1; |
| 50 } | 46 } |
| 51 | 47 |
| 52 # Some targets can't do function calls, so don't even bother with this | 48 # Some targets can't do function calls, so don't even bother with this |
| 53 # test. | 49 # test. |
| 54 if [target_info exists gdb,cannot_call_functions] { | 50 if [target_info exists gdb,cannot_call_functions] { |
| 55 setup_xfail "*-*-*" 2416 | 51 setup_xfail "*-*-*" 2416 |
| 56 fail "This target can not call functions" | 52 fail "This target can not call functions" |
| 57 continue | 53 continue |
| 58 } | 54 } |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 print_struct_call "print_five_chars(*five_char)" \ | 158 print_struct_call "print_five_chars(*five_char)" \ |
| 163 ".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[
\t\]+o\[ \r\n\]+.\[0-9\]+ = \\{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4
= 108 'l', ch5 = 111 'o'\\}" | 159 ".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[
\t\]+o\[ \r\n\]+.\[0-9\]+ = \\{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4
= 108 'l', ch5 = 111 'o'\\}" |
| 164 } | 160 } |
| 165 | 161 |
| 166 if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] { | 162 if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] { |
| 167 print_struct_call "print_int_char_combo(*int_char_combo)" \ | 163 print_struct_call "print_int_char_combo(*int_char_combo)" \ |
| 168 ".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+.\[0-
9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}" | 164 ".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+.\[0-
9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}" |
| 169 } | 165 } |
| 170 | 166 |
| 171 return | 167 return |
| OLD | NEW |