]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.cp/oranking.exp
72a3cf3cbcfa8e6250ffa1a124e0bc4b8876fb15
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cp / oranking.exp
1 # Copyright 2008-2023 Free Software Foundation, Inc.
2
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
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/>.
15
16 standard_testfile .cc
17
18 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } {
19 return -1
20 }
21
22 ############################################
23
24 if {![runto_main]} {
25 return
26 }
27
28 gdb_breakpoint [gdb_get_line_number "end of main"]
29 gdb_continue_to_breakpoint "end of main"
30
31 # The 'test*' functions are to prove our understanding
32 # of the overload resolution performed by the compiler
33 # So, they should always pass, and the returned value
34 # should match the corresponding call to 'foo*'
35
36 setup_kfail "gdb/12096" *-*-*
37 gdb_test "p foo0(b)" "10"
38
39 gdb_test "p test1()" "12"
40 gdb_test "p foo1(b)" "12"
41
42 gdb_test "p test2()" "13"
43 setup_kfail "gdb/12098" *-*-*
44 gdb_test "p foo2(b)" "13"
45
46 gdb_test "p test3()" "21"
47 gdb_test "p foo3(1.0f)" "21"
48
49 gdb_test "p test4()" "24"
50 gdb_test "p foo4(&a)" "24"
51
52 gdb_test "p test5()" "26"
53 gdb_test "p foo5(c)" "26"
54
55 gdb_test "p test6()" "28"
56 gdb_test "p foo6(bp)" "28"
57
58 gdb_test "p test7()" "210"
59 gdb_test "p foo7(cp)" "210"
60
61 gdb_test "p test8()" "212"
62 gdb_test "p foo8(co)" "212"
63
64 gdb_test "p test9()" "214"
65 gdb_test "p foo9(co)" "214"
66
67 gdb_test "p test10()" "216"
68 setup_kfail "gdb/12098" *-*-*
69 gdb_test "p foo10(amp)" "216"
70
71 gdb_test "p test101()" "218"
72 gdb_test "p foo101(\"abc\")" "218"
73
74 gdb_test "p test11()" "32"
75 setup_kfail "gdb/12096" *-*-*
76 gdb_test "p foo11(d)" "32"
77
78 gdb_test "p test12()" "42"
79 # this passes only because gdb does not yet
80 # implement template function calling
81 gdb_test "p foo12(1)" "42"
82
83 gdb_test "p test13()" "44"
84 setup_kfail "gdb/12098" *-*-*
85 gdb_test "p foo13(c)" "44"
86
87 gdb_test "p test14()" "46"
88 setup_kfail "gdb/12096" *-*-*
89 gdb_test "p foo14(e)" "46"
90
91 gdb_test "p test15 ()" "194"
92 gdb_test "p foo15 (c)" "47"
93 gdb_test "p foo15 (cc)" "48"
94 gdb_test "p foo15 (vc)" "49"
95 gdb_test "p foo15 (cvc)" "50"