]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.dwarf2/dw2-inline-break.exp
daily update
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.dwarf2 / dw2-inline-break.exp
CommitLineData
28e7fd62 1# Copyright 2012-2013 Free Software Foundation, Inc.
481860b3
GB
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# Note that the testcase gdb.opt/inline-break.exp largely mirrors
17# this testcase, and should be updated if this testcase is changed.
18
19load_lib dwarf.exp
20
21# This test can only be run on targets which support DWARF-2 and use gas.
22if ![dwarf2_support] {
23 return 0
24}
25
26# This test can only be run on x86_64 targets.
27if {![istarget "x86_64-*-*"] || ![is_lp64_target]} {
28 return 0
29}
30
31set basename "inline-break"
481860b3 32
c83ee902
TT
33standard_testfile .S
34
35if { [prepare_for_testing $testfile.exp $testfile $srcfile {nodebug}] } {
481860b3
GB
36 return -1
37}
38
39#
40# func1 is a static inlined function that is called once.
41# The result should be a single-location breakpoint.
42#
43gdb_test "break func1" \
44 "Breakpoint.*at.* file .*$basename\\.c, line.*"
45
46#
47# func2 is a non-static inlined function that is called once.
48# The result should be a breakpoint with two locations: the
49# out-of-line function and the single inlined instance.
50#
51gdb_test "break func2" \
52 "Breakpoint.*at.*func2.*\\(2 locations\\)"
53
54#
55# func3b is a static inlined function that is called once from
56# within another static inlined function. The result should be
57# a single-location breakpoint.
58#
59gdb_test "break func3b" \
60 "Breakpoint.*at.* file .*$basename\\.c, line.*"
61
62#
63# func4b is a static inlined function that is called once from
64# within a non-static inlined function. The result should be
65# a breakpoint with two locations: the inlined instance within
66# the inlined call to func4a in main, and the inlined instance
67# within the out-of-line func4a.
68#
69gdb_test "break func4b" \
70 "Breakpoint.*at.*func4b.*\\(2 locations\\)"
71
72#
73# func5b is a non-static inlined function that is called once
74# from within a static inlined function. The result should be a
75# breakpoint with two locations: the out-of-line function and the
76# inlined instance within the inlined call to func5a in main.
77#
78gdb_test "break func5b" \
79 "Breakpoint.*at.*func5b.*\\(2 locations\\)"
80#
81# func6b is a non-static inlined function that is called once from
82# within another non-static inlined function. The result should be
83# a breakpoint with three locations: the out-of-line function, the
84# inlined instance within the out-of-line func6a, and the inlined
85# instance within the inlined call to func6a in main,
86#
87gdb_test "break func6b" \
88 "Breakpoint.*at.*func6b.*\\(3 locations\\)"
89
90#
91# func7b is a static inlined function that is called twice: once from
92# func7a, and once from main. The result should be a breakpoint with
93# two locations: the inlined instance within the inlined instance of
94# func7a, and the inlined instance within main.
95#
96gdb_test "break func7b" \
97 "Breakpoint.*at.*func7b.*\\(2 locations\\)"
98
99#
100# func8b is a non-static inlined function that is called twice: once
101# func8a, and once from main. The result should be a breakpoint with
102# three locations: the out-of-line function, the inlined instance
103# within the inlined instance of func7a, and the inlined instance
104# within main.
105#
106gdb_test "break func8b" \
107 "Breakpoint.*at.*func8b.*\\(3 locations\\)"
108
109#
110# func1 is a static inlined function. The result should be that no
111# symbol is found to print.
112#
113gdb_test "print func1" \
114 "No symbol \"func1\" in current context."
115
116#
117# func2 is a non-static inlined function. The result should be that
118# one symbol is found to print, and that the printed symbol is called
119# "func2". Note that this does not cover the failure case that two
120# symbols were found, but that gdb chose the out-of-line copy to
121# print, but if this was failing the "print func1" test would likely
122# fail instead.
123#
124gdb_test "print func2" \
125 "\\\$.* = {int \\(int\\)} .* <func2>"