1#! /bin/sh
2# Copyright (C) 2018 Red Hat, Inc.
3# This file is part of elfutils.
4#
5# This file 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# elfutils is distributed in the hope that it will be useful, but
11# 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. $srcdir/test-subr.sh
19
20# See run-typeiter.sh
21testfiles testfile-debug-types
22
23testrun ${abs_builddir}/get-units-split testfile-debug-types
24
25# see run-readelf-dwz-multi.sh
26testfiles testfile_multi_main testfile_multi.dwz
27
28testrun ${abs_builddir}/get-units-split testfile_multi_main
29
30# see tests/run-dwflsyms.sh
31testfiles testfilebazdbgppc64.debug
32
33testrun ${abs_builddir}/get-units-split testfilebazdbgppc64.debug
34
35# see tests/testfile-dwarf-45.source
36testfiles testfile-dwarf-4 testfile-dwarf-5
37testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo
38testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo
39
40testrun ${abs_builddir}/get-units-split testfile-dwarf-4
41testrun ${abs_builddir}/get-units-split testfile-dwarf-5
42
43# These two files are the only ones that actually have skeleton units.
44testrun_compare ${abs_builddir}/get-units-split testfile-splitdwarf-4 << \EOF
45file: testfile-splitdwarf-4
46Got cudie unit_type: 4
47Found a skeleton unit, with split die: hello.c
48Got cudie unit_type: 4
49Found a skeleton unit, with split die: world.c
50
51EOF
52
53testrun_compare ${abs_builddir}/get-units-split testfile-splitdwarf-5 << \EOF
54file: testfile-splitdwarf-5
55Got cudie unit_type: 4
56Found a skeleton unit, with split die: hello.c
57Got cudie unit_type: 4
58Found a skeleton unit, with split die: world.c
59
60EOF
61
62# Self test (Not on obj files since those need relocation first).
63testrun_on_self_exe ${abs_builddir}/get-units-split
64testrun_on_self_lib ${abs_builddir}/get-units-split
65
66exit 0
67