1da0c48c4Sopenharmony_ci#! /bin/sh
2da0c48c4Sopenharmony_ci# Copyright (C) 2014 Red Hat, Inc.
3da0c48c4Sopenharmony_ci# This file is part of elfutils.
4da0c48c4Sopenharmony_ci#
5da0c48c4Sopenharmony_ci# This file is free software; you can redistribute it and/or modify
6da0c48c4Sopenharmony_ci# it under the terms of the GNU General Public License as published by
7da0c48c4Sopenharmony_ci# the Free Software Foundation; either version 3 of the License, or
8da0c48c4Sopenharmony_ci# (at your option) any later version.
9da0c48c4Sopenharmony_ci#
10da0c48c4Sopenharmony_ci# elfutils is distributed in the hope that it will be useful, but
11da0c48c4Sopenharmony_ci# WITHOUT ANY WARRANTY; without even the implied warranty of
12da0c48c4Sopenharmony_ci# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13da0c48c4Sopenharmony_ci# GNU General Public License for more details.
14da0c48c4Sopenharmony_ci#
15da0c48c4Sopenharmony_ci# You should have received a copy of the GNU General Public License
16da0c48c4Sopenharmony_ci# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17da0c48c4Sopenharmony_ci
18da0c48c4Sopenharmony_ci. $srcdir/test-subr.sh
19da0c48c4Sopenharmony_ci
20da0c48c4Sopenharmony_ci# See run-addr2line-test.sh run-addr2line-i-test.sh run-addr2line-i-lex-test.sh
21da0c48c4Sopenharmony_ci# Output/files/lines matched should equal what is done through addr2line
22da0c48c4Sopenharmony_ci# which uses dwfl_module_getsrc. This test uses dwarf_addrdie and
23da0c48c4Sopenharmony_ci# dwarf_getsrc_die
24da0c48c4Sopenharmony_citestfiles testfile testfile-inlines testfile-lex-inlines
25da0c48c4Sopenharmony_ci
26da0c48c4Sopenharmony_citestrun_compare ${abs_top_builddir}/tests/getsrc_die testfile 0x08048468 0x0804845c <<\EOF
27da0c48c4Sopenharmony_ci/home/drepper/gnu/new-bu/build/ttt/f.c:3
28da0c48c4Sopenharmony_ci/home/drepper/gnu/new-bu/build/ttt/b.c:4
29da0c48c4Sopenharmony_ciEOF
30da0c48c4Sopenharmony_ci
31da0c48c4Sopenharmony_citestrun_compare ${abs_top_builddir}/tests/getsrc_die testfile-inlines 0x00000000000005a0 0x00000000000005a1 0x00000000000005b0 0x00000000000005b1 0x00000000000005c0 0x00000000000005d0 0x00000000000005e0 0x00000000000005e1 0x00000000000005f1 0x00000000000005f2 <<\EOF
32da0c48c4Sopenharmony_ci/tmp/x.cpp:5
33da0c48c4Sopenharmony_ci/tmp/x.cpp:6
34da0c48c4Sopenharmony_ci/tmp/x.cpp:10
35da0c48c4Sopenharmony_ci/tmp/x.cpp:11
36da0c48c4Sopenharmony_ci/tmp/x.cpp:5
37da0c48c4Sopenharmony_ci/tmp/x.cpp:10
38da0c48c4Sopenharmony_ci/tmp/x.cpp:5
39da0c48c4Sopenharmony_ci/tmp/x.cpp:10
40da0c48c4Sopenharmony_ci/tmp/x.cpp:10
41da0c48c4Sopenharmony_ci/tmp/x.cpp:5
42da0c48c4Sopenharmony_ciEOF
43da0c48c4Sopenharmony_ci
44da0c48c4Sopenharmony_citestrun_compare ${abs_top_builddir}/tests/getsrc_die testfile-lex-inlines 0x0000000000000680 0x0000000000000681 0x0000000000000690 0x0000000000000691 <<\EOF
45da0c48c4Sopenharmony_ci/tmp/x.cpp:5
46da0c48c4Sopenharmony_ci/tmp/x.cpp:5
47da0c48c4Sopenharmony_ci/tmp/x.cpp:5
48da0c48c4Sopenharmony_ci/tmp/x.cpp:5
49da0c48c4Sopenharmony_ciEOF
50da0c48c4Sopenharmony_ci
51da0c48c4Sopenharmony_ciexit 0
52