blob: 160f07d21f9c709f87dcde33bcf5beffb8801f83 [file] [log] [blame]
Roland McGrath07d4f2f2005-10-28 06:56:24 +00001#! /bin/sh
2# Copyright (C) 2005 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02003# This file is part of elfutils.
Roland McGrath07d4f2f2005-10-28 06:56:24 +00004#
Mark Wielaardde2ed972012-06-05 17:15:16 +02005# 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.
Roland McGrath07d4f2f2005-10-28 06:56:24 +00009#
Mark Wielaardde2ed972012-06-05 17:15:16 +020010# elfutils is distributed in the hope that it will be useful, but
Ulrich Drepper361df7d2006-04-04 21:38:57 +000011# WITHOUT ANY WARRANTY; without even the implied warranty of
Mark Wielaardde2ed972012-06-05 17:15:16 +020012# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
Ulrich Drepper361df7d2006-04-04 21:38:57 +000014#
Mark Wielaardde2ed972012-06-05 17:15:16 +020015# 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/>.
Ulrich Drepper361df7d2006-04-04 21:38:57 +000017
Roland McGrath1b8b4462005-11-16 01:33:38 +000018. $srcdir/test-subr.sh
Roland McGrath07d4f2f2005-10-28 06:56:24 +000019
Roland McGrath1b8b4462005-11-16 01:33:38 +000020testfiles testfile testfile11 testfile22 testfile24 \
21 testfile25 testfile3 testfile4 testfile5 testfile6
Roland McGrath07d4f2f2005-10-28 06:56:24 +000022
Mark Wielaard86be7922013-04-26 23:44:25 +020023testrun_compare ${abs_builddir}/find-prologues -e testfile <<\EOF
Roland McGrath07d4f2f2005-10-28 06:56:24 +000024main 0x000000000804842c 0x0000000008048432
25bar 0x000000000804845c 0x000000000804845f
26foo 0x0000000008048468 0x000000000804846b
Roland McGrath1b8b4462005-11-16 01:33:38 +000027EOF
28
Mark Wielaard86be7922013-04-26 23:44:25 +020029testrun_compare ${abs_builddir}/find-prologues -e testfile11 <<\EOF
Roland McGrath07d4f2f2005-10-28 06:56:24 +000030main 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
Mark Wielaard86be7922013-04-26 23:44:25 +020040testrun_compare ${abs_builddir}/find-prologues -e testfile22 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000041function 0x0000000008048348 0x000000000804834e
42main 0x000000000804835b 0x0000000008048377
43EOF
44
Mark Wielaard86be7922013-04-26 23:44:25 +020045testrun_compare ${abs_builddir}/find-prologues -e testfile24 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000046incr 0x0000000008048348 0x000000000804834e
47main 0x0000000008048354 0x0000000008048360
48EOF
49
Mark Wielaard86be7922013-04-26 23:44:25 +020050testrun_compare ${abs_builddir}/find-prologues -e testfile25 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000051incr 0x0000000008048348 0x000000000804834c
52EOF
53
Mark Wielaard86be7922013-04-26 23:44:25 +020054testrun_compare ${abs_builddir}/find-prologues -e testfile3 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000055main 0x000000000804842c 0x0000000008048433
56bar 0x0000000008048458 0x000000000804845b
57foo 0x0000000008048464 0x0000000008048467
58EOF
59
Mark Wielaard86be7922013-04-26 23:44:25 +020060testrun_compare ${abs_builddir}/find-prologues -e testfile4 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000061get 0x00000000080493fc 0x0000000008049402
62main 0x0000000008049498 0x000000000804949e
63a 0x000000000804d85c 0x000000000804d85c
64__tfPCc 0x000000000804d86c 0x000000000804d872
65__tfCc 0x000000000804d8a4 0x000000000804d8a4
66EOF
67
Mark Wielaard86be7922013-04-26 23:44:25 +020068testrun_compare ${abs_builddir}/find-prologues -e testfile5 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000069bar 0x000000000804842c 0x000000000804842f
70foo 0x0000000008048438 0x000000000804843b
71main 0x0000000008048444 0x000000000804844a
72EOF
73
Mark Wielaard86be7922013-04-26 23:44:25 +020074testrun_compare ${abs_builddir}/find-prologues -e testfile6 <<\EOF
Roland McGrath1b8b4462005-11-16 01:33:38 +000075main 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