103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes#! /bin/sh 203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# Copyright (C) 2005, 2013 Red Hat, Inc. 303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# This file is part of elfutils. 403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# Written by Ulrich Drepper <drepper@redhat.com>, 2005. 503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# This file is free software; you can redistribute it and/or modify 703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# it under the terms of the GNU General Public License as published by 803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# the Free Software Foundation; either version 3 of the License, or 903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# (at your option) any later version. 1003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 1103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# elfutils is distributed in the hope that it will be useful, but 1203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# WITHOUT ANY WARRANTY; without even the implied warranty of 1303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# GNU General Public License for more details. 1503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 1603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# You should have received a copy of the GNU General Public License 1703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# along with this program. If not, see <http://www.gnu.org/licenses/>. 1803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 1903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes. $srcdir/test-subr.sh 2003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 2103333823c75a1c1887e923828113a1b0fd12020cElliott Hughestestfiles testfile testfile2 testfile8 2203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 2303333823c75a1c1887e923828113a1b0fd12020cElliott Hughestestrun_compare ${abs_builddir}/allfcts testfile testfile2 testfile8 <<\EOF 2403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/new-bu/build/ttt/m.c:5:main 2503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/new-bu/build/ttt/b.c:4:bar 2603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/new-bu/build/ttt/f.c:3:foo 2703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/shoggoth/drepper/b.c:4:bar 2803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/shoggoth/drepper/f.c:3:foo 2903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/shoggoth/drepper/m.c:5:main 3003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:107:main 3103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:159:print_version 3203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:173:parse_opt 3303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:201:more_help 3403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:217:process_file 3503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/usr/include/sys/stat.h:375:stat64 3603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:291:crc32_file 3703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/drepper/gnu/elfutils/build/src/../../src/strip.c:313:handle_elf 3803333823c75a1c1887e923828113a1b0fd12020cElliott HughesEOF 3903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 4003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# = nested_funcs.c = 4103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 4203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# static int 4303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# foo (int x) 4403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# { 4503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# int bar (int y) 4603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# { 4703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# return x - y; 4803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# } 4903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 5003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# return bar (x * 2); 5103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# } 5203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 5303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# int 5403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# main (int argc, char ** argv) 5503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# { 5603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# return foo (argc); 5703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# } 5803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 5903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# gcc -g -o nested_funcs nested_funcs.c 6003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 6103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# = class_func.cxx = 6203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 6303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# namespace foobar 6403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# { 6503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# class Foo 6603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# { 6703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# public: 6803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# int bar(int x); 6903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# }; 7003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 7103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# int Foo::bar(int x) { return x - 42; } 7203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# }; 7303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 7403333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# int 7503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# main (int argc, char **argv) 7603333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# { 7703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# foobar::Foo foo; 7803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 7903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# return foo.bar (42); 8003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# } 8103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# 8203333823c75a1c1887e923828113a1b0fd12020cElliott Hughes# clang++ -g -o class_func class_func.cxx 8303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 8403333823c75a1c1887e923828113a1b0fd12020cElliott Hughestestfiles testfile_nested_funcs testfile_class_func 8503333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 8603333823c75a1c1887e923828113a1b0fd12020cElliott Hughestestrun_compare ${abs_builddir}/allfcts testfile_nested_funcs testfile_class_func <<\EOF 8703333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/mark/src/tests/nested/nested_funcs.c:2:foo 8803333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/mark/src/tests/nested/nested_funcs.c:4:bar 8903333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/mark/src/tests/nested/nested_funcs.c:13:main 9003333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/mark/src/tests/nested/class_func.cxx:6:bar 9103333823c75a1c1887e923828113a1b0fd12020cElliott Hughes/home/mark/src/tests/nested/class_func.cxx:13:main 9203333823c75a1c1887e923828113a1b0fd12020cElliott HughesEOF 9303333823c75a1c1887e923828113a1b0fd12020cElliott Hughes 9403333823c75a1c1887e923828113a1b0fd12020cElliott Hughesexit 0 95