Home | History | Annotate | Download | only in tests
      1 #! /bin/sh
      2 # Copyright (C) 2014 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 # // g++ x.cpp -g -fPIC -olibx.so -shared -O3 -fvisibility=hidden
     21 #
     22 # void foobar()
     23 # {
     24 #   __asm__ ( "nop" ::: );
     25 # }
     26 #
     27 # void foo()
     28 # {
     29 #   {
     30 #     void (*bar) () = foobar;
     31 #     bar();
     32 #   }
     33 # }
     34 
     35 testfiles testfile-lex-inlines
     36 
     37 testrun_compare ${abs_top_builddir}/src/addr2line -i -e testfile-lex-inlines 0x0000000000000680 <<\EOF
     38 /tmp/x.cpp:5
     39 EOF
     40 
     41 testrun_compare ${abs_top_builddir}/src/addr2line -i -e testfile-lex-inlines 0x0000000000000681 <<\EOF
     42 /tmp/x.cpp:5
     43 EOF
     44 
     45 testrun_compare ${abs_top_builddir}/src/addr2line -i -e testfile-lex-inlines 0x0000000000000690 <<\EOF
     46 /tmp/x.cpp:5
     47 /tmp/x.cpp:12
     48 EOF
     49 
     50 testrun_compare ${abs_top_builddir}/src/addr2line -i -e testfile-lex-inlines 0x0000000000000691 <<\EOF
     51 /tmp/x.cpp:5
     52 /tmp/x.cpp:12
     53 EOF
     54 
     55 # All together now (plus function names).
     56 testrun_compare ${abs_top_builddir}/src/addr2line -f -i -e testfile-lex-inlines 0x0000000000000680 0x0000000000000681 0x0000000000000690 0x0000000000000691 <<\EOF
     57 _Z6foobarv
     58 /tmp/x.cpp:5
     59 _Z6foobarv
     60 /tmp/x.cpp:5
     61 foobar inlined at /tmp/x.cpp:12 in _Z3foov
     62 /tmp/x.cpp:5
     63 _Z3foov
     64 /tmp/x.cpp:12
     65 foobar inlined at /tmp/x.cpp:12 in _Z3foov
     66 /tmp/x.cpp:5
     67 _Z3foov
     68 /tmp/x.cpp:12
     69 EOF
     70 
     71 exit 0
     72