blob: 2687babba9794f7146439ea0523352cdcf04c84f [file] [log] [blame]
Tom Tromey581c3f62012-03-21 08:54:32 -06001#! /bin/sh
Mark Wielaard47efc3b2015-01-14 21:38:16 +01002# Copyright (C) 2012, 2015 Red Hat, Inc.
Mark Wielaardde2ed972012-06-05 17:15:16 +02003# This file is part of elfutils.
Tom Tromey581c3f62012-03-21 08:54:32 -06004#
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.
Tom Tromey581c3f62012-03-21 08:54:32 -06009#
Mark Wielaardde2ed972012-06-05 17:15:16 +020010# elfutils is distributed in the hope that it will be useful, but
Tom Tromey581c3f62012-03-21 08:54:32 -060011# 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.
Tom Tromey581c3f62012-03-21 08:54:32 -060014#
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/>.
Tom Tromey581c3f62012-03-21 08:54:32 -060017
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 Wielaard47efc3b2015-01-14 21:38:16 +010044# 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
47testfiles testfile59 testfile-debug-types
Tom Tromey581c3f62012-03-21 08:54:32 -060048
Mark Wielaard86be7922013-04-26 23:44:25 +020049testrun_compare ${abs_builddir}/typeiter testfile59 <<\EOF
Tom Tromey581c3f62012-03-21 08:54:32 -060050ok
51EOF
52
Josh Stone5dbbc5e2013-10-03 12:38:25 -070053testrun_compare ${abs_builddir}/typeiter2 testfile59 <<\EOF
Mark Wielaard47efc3b2015-01-14 21:38:16 +010054ok s1 [25]
55EOF
56
57testrun_compare ${abs_builddir}/typeiter2 testfile-debug-types <<\EOF
58ok A [68]
59ok B [38]
Josh Stone5dbbc5e2013-10-03 12:38:25 -070060EOF
61
Tom Tromey581c3f62012-03-21 08:54:32 -060062exit 0