1#!/usr/local/bin/bash
2# Copyright (C) 2012, 2015 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# 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
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
47testfiles testfile59 testfile-debug-types
48
49testrun_compare ${abs_builddir}/typeiter testfile59 <<\EOF
50ok
51EOF
52
53testrun_compare ${abs_builddir}/typeiter2 testfile59 <<\EOF
54ok s1 [25]
55EOF
56
57testrun_compare ${abs_builddir}/typeiter2 testfile-debug-types <<\EOF
58ok A [68]
59ok B [38]
60EOF
61
62exit 0
63