Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 1 | #! /bin/sh |
Mark Wielaard | 47efc3b | 2015-01-14 21:38:16 +0100 | [diff] [blame] | 2 | # Copyright (C) 2012, 2015 Red Hat, Inc. |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 3 | # This file is part of elfutils. |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 4 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 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. |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 9 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 10 | # elfutils is distributed in the hope that it will be useful, but |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | # GNU General Public License for more details. |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 14 | # |
Mark Wielaard | de2ed97 | 2012-06-05 17:15:16 +0200 | [diff] [blame] | 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/>. |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 17 | |
| 18 | . $srcdir/test-subr.sh |
| 19 | |
| 20 | # struct s1 |
| 21 | # { |
| 22 | # char c; |
| 23 | # short s; |
| 24 | # int i; |
| 25 | # long l; |
| 26 | # float f; |
| 27 | # double d; |
| 28 | # }; |
| 29 | # |
| 30 | # s1 S1; |
| 31 | # |
| 32 | # int func (s1 *p) |
| 33 | # { |
| 34 | # return p->i; |
| 35 | # } |
| 36 | # |
| 37 | # int main() |
| 38 | # { |
| 39 | # return func (&S1); |
| 40 | # } |
| 41 | # |
| 42 | # g++ -gdwarf-4 -g -fdebug-types-section |
| 43 | |
Mark Wielaard | 47efc3b | 2015-01-14 21:38:16 +0100 | [diff] [blame] | 44 | # echo 'struct A{ struct B {} x;};A a; A::B b;int main(){return 0;}' \ |
| 45 | # | g++ -x c++ -g -fdebug-types-section -o testfile-debug-types - |
| 46 | |
| 47 | testfiles testfile59 testfile-debug-types |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 48 | |
Mark Wielaard | 86be792 | 2013-04-26 23:44:25 +0200 | [diff] [blame] | 49 | testrun_compare ${abs_builddir}/typeiter testfile59 <<\EOF |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 50 | ok |
| 51 | EOF |
| 52 | |
Josh Stone | 5dbbc5e | 2013-10-03 12:38:25 -0700 | [diff] [blame] | 53 | testrun_compare ${abs_builddir}/typeiter2 testfile59 <<\EOF |
Mark Wielaard | 47efc3b | 2015-01-14 21:38:16 +0100 | [diff] [blame] | 54 | ok s1 [25] |
| 55 | EOF |
| 56 | |
| 57 | testrun_compare ${abs_builddir}/typeiter2 testfile-debug-types <<\EOF |
| 58 | ok A [68] |
| 59 | ok B [38] |
Josh Stone | 5dbbc5e | 2013-10-03 12:38:25 -0700 | [diff] [blame] | 60 | EOF |
| 61 | |
Tom Tromey | 581c3f6 | 2012-03-21 08:54:32 -0600 | [diff] [blame] | 62 | exit 0 |