1#! /bin/sh
2# Copyright (C) 2005 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
20testfiles testfile testfile11 testfile22 testfile24 \
21	  testfile25 testfile3 testfile4 testfile5 testfile6
22
23testrun_compare ${abs_builddir}/find-prologues -e testfile <<\EOF
24main             0x000000000804842c 0x0000000008048432
25bar              0x000000000804845c 0x000000000804845f
26foo              0x0000000008048468 0x000000000804846b
27EOF
28
29testrun_compare ${abs_builddir}/find-prologues -e testfile11 <<\EOF
30main             0x00000000080489b8 0x00000000080489cd
31gnu_obj_2        0x0000000008048c9e 0x0000000008048ca4
32gnu_obj_3        0x0000000008048cd8 0x0000000008048cde
33gnu_obj_2        0x0000000008048cf4 0x0000000008048cfa
34~invalid_argument 0x0000000008048d2e 0x0000000008048d34
35gnu_obj_1        0x0000000008048d62 0x0000000008048d65
36gnu_obj_1        0x0000000008048d8a 0x0000000008048d8d
37~invalid_argument 0x0000000008048db2 0x0000000008048db8
38EOF
39
40testrun_compare ${abs_builddir}/find-prologues -e testfile22 <<\EOF
41function         0x0000000008048348 0x000000000804834e
42main             0x000000000804835b 0x0000000008048377
43EOF
44
45testrun_compare ${abs_builddir}/find-prologues -e testfile24 <<\EOF
46incr             0x0000000008048348 0x000000000804834e
47main             0x0000000008048354 0x0000000008048360
48EOF
49
50testrun_compare ${abs_builddir}/find-prologues -e testfile25 <<\EOF
51incr             0x0000000008048348 0x000000000804834c
52EOF
53
54testrun_compare ${abs_builddir}/find-prologues -e testfile3 <<\EOF
55main             0x000000000804842c 0x0000000008048433
56bar              0x0000000008048458 0x000000000804845b
57foo              0x0000000008048464 0x0000000008048467
58EOF
59
60testrun_compare ${abs_builddir}/find-prologues -e testfile4 <<\EOF
61get              0x00000000080493fc 0x0000000008049402
62main             0x0000000008049498 0x000000000804949e
63a                0x000000000804d85c 0x000000000804d85c
64__tfPCc          0x000000000804d86c 0x000000000804d872
65__tfCc           0x000000000804d8a4 0x000000000804d8a4
66EOF
67
68testrun_compare ${abs_builddir}/find-prologues -e testfile5 <<\EOF
69bar              0x000000000804842c 0x000000000804842f
70foo              0x0000000008048438 0x000000000804843b
71main             0x0000000008048444 0x000000000804844a
72EOF
73
74testrun_compare ${abs_builddir}/find-prologues -e testfile6 <<\EOF
75main             0x00000000080489b8 0x00000000080489cd
76gnu_obj_2        0x0000000008048c9e 0x0000000008048ca4
77gnu_obj_3        0x0000000008048cd8 0x0000000008048cde
78gnu_obj_2        0x0000000008048cf4 0x0000000008048cfa
79~invalid_argument 0x0000000008048d2e 0x0000000008048d34
80gnu_obj_1        0x0000000008048d62 0x0000000008048d65
81gnu_obj_1        0x0000000008048d8a 0x0000000008048d8d
82~invalid_argument 0x0000000008048db2 0x0000000008048db8
83EOF
84
85exit 0
86