|
| 1 | +# Copyright 2010 Free Software Foundation, Inc. |
| 2 | +# |
| 3 | +# Contributed by Red Hat, originally written by Keith Seitz. |
| 4 | +# |
| 5 | +# This program is free software; you can redistribute it and/or modify |
| 6 | +# it under the terms of the GNU General Public License as published by |
| 7 | +# the Free Software Foundation; either version 3 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | +# |
| 10 | +# This program is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +# GNU General Public License for more details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU General Public License |
| 16 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +# This file is part of the gdb testsuite. |
| 19 | + |
| 20 | +if { [skip_cplus_tests] } { continue } |
| 21 | + |
| 22 | +set testfile "pr11734" |
| 23 | +set class $testfile |
| 24 | + |
| 25 | +set srcfiles {} |
| 26 | +for {set i 1} {$i < 5} {incr i} { |
| 27 | + lappend srcfiles $testfile-$i.cc |
| 28 | +} |
| 29 | + |
| 30 | +prepare_for_testing pr11734 $testfile $srcfiles {c++ debug} |
| 31 | + |
| 32 | +if {![runto_main]} { |
| 33 | + perror "couldn't run to breakpoint" |
| 34 | + continue |
| 35 | +} |
| 36 | + |
| 37 | +# An array holding the overload types for the method pr11734::foo. The |
| 38 | +# first element is the overloaded method parameter. The second element |
| 39 | +# is the expected source file number, e.g. "pr11734-?.cc". |
| 40 | +array set tests { |
| 41 | + "char*" 4 |
| 42 | + "int" 3 |
| 43 | + "" 2 |
| 44 | +} |
| 45 | + |
| 46 | +# Test each overload instance twice: once quoted, once unquoted |
| 47 | +foreach ovld [array names tests] { |
| 48 | + set method "${class}::foo\($ovld\)" |
| 49 | + set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*" |
| 50 | + gdb_test "break $method" $result |
| 51 | + gdb_test "break '$method'" $result |
| 52 | +} |
| 53 | + |
| 54 | +gdb_exit |
| 55 | +return 0 |
0 commit comments