1#! /bin/sh 2# Copyright (C) 1999, 2000, 2002, 2004, 2005, 2007 Red Hat, Inc. 3# This file is part of elfutils. 4# Written by Ulrich Drepper <[email protected]>, 1999. 5# 6# This file is free software; you can redistribute it and/or modify 7# it under the terms of the GNU General Public License as published by 8# the Free Software Foundation; either version 3 of the License, or 9# (at your option) any later version. 10# 11# elfutils is distributed in the hope that it will be useful, but 12# WITHOUT ANY WARRANTY; without even the implied warranty of 13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14# GNU General Public License for more details. 15# 16# You should have received a copy of the GNU General Public License 17# along with this program. If not, see <http://www.gnu.org/licenses/>. 18 19. $srcdir/test-subr.sh 20 21testfiles testfile testfile2 22 23testrun_compare ${abs_builddir}/get-files testfile testfile2 <<\EOF 24cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 191 25 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt" 26 file[0] = "???" 27 file[1] = "/home/drepper/gnu/new-bu/build/ttt/m.c" 28cuhl = 11, o = 114, asz = 4, osz = 4, ncu = 5617 29 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt" 30 file[0] = "???" 31 file[1] = "/home/drepper/gnu/new-bu/build/ttt/b.c" 32 file[2] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stddef.h" 33 file[3] = "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdarg.h" 34 file[4] = "/usr/include/bits/types.h" 35 file[5] = "/usr/include/bits/sched.h" 36 file[6] = "/usr/include/bits/pthreadtypes.h" 37 file[7] = "/usr/include/stdio.h" 38 file[8] = "/usr/include/libio.h" 39 file[9] = "/usr/include/wchar.h" 40 file[10] = "/usr/include/_G_config.h" 41 file[11] = "/usr/include/gconv.h" 42cuhl = 11, o = 412, asz = 4, osz = 4, ncu = 5752 43 dirs[0] = "/home/drepper/gnu/new-bu/build/ttt" 44 file[0] = "???" 45 file[1] = "/home/drepper/gnu/new-bu/build/ttt/f.c" 46cuhl = 11, o = 0, asz = 4, osz = 4, ncu = 2418 47 dirs[0] = "/shoggoth/drepper" 48 file[0] = "???" 49 file[1] = "/shoggoth/drepper/b.c" 50 file[2] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stddef.h" 51 file[3] = "/home/geoffk/objs/laurel-000912-branch/lib/gcc-lib/powerpc-unknown-linux-gnu/2.96-laurel-000912/include/stdarg.h" 52 file[4] = "/shoggoth/drepper/<built-in>" 53 file[5] = "/usr/include/bits/types.h" 54 file[6] = "/usr/include/stdio.h" 55 file[7] = "/usr/include/libio.h" 56 file[8] = "/usr/include/_G_config.h" 57cuhl = 11, o = 213, asz = 4, osz = 4, ncu = 2521 58 dirs[0] = "/shoggoth/drepper" 59 file[0] = "???" 60 file[1] = "/shoggoth/drepper/f.c" 61cuhl = 11, o = 267, asz = 4, osz = 4, ncu = 2680 62 dirs[0] = "/shoggoth/drepper" 63 file[0] = "???" 64 file[1] = "/shoggoth/drepper/m.c" 65EOF 66 67# see tests/testfile-dwarf-45.source 68testfiles testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo 69testfiles testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo 70 71testrun_compare ${abs_builddir}/get-files testfile-splitdwarf-4 testfile-hello4.dwo testfile-world4.dwo <<\EOF 72cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 52 73 dirs[0] = "/home/mark/src/elfutils/tests" 74 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" 75 file[0] = "???" 76 file[1] = "/home/mark/src/elfutils/tests/hello.c" 77 file[2] = "/home/mark/src/elfutils/tests/hello.h" 78 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" 79cuhl = 11, o = 26, asz = 8, osz = 4, ncu = 104 80 dirs[0] = "/home/mark/src/elfutils/tests" 81 dirs[1] = "/usr/include" 82 file[0] = "???" 83 file[1] = "/home/mark/src/elfutils/tests/world.c" 84 file[2] = "/home/mark/src/elfutils/tests/hello.h" 85 file[3] = "/usr/include/stdlib.h" 86cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 414 87 dirs[0] = "/home/mark/src/elfutils/tests" 88 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" 89 file[0] = "???" 90 file[1] = "/home/mark/src/elfutils/tests/hello.c" 91 file[2] = "/home/mark/src/elfutils/tests/hello.h" 92 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" 93cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 331 94 dirs[0] = "/home/mark/src/elfutils/tests" 95 dirs[1] = "/usr/include" 96 file[0] = "???" 97 file[1] = "/home/mark/src/elfutils/tests/world.c" 98 file[2] = "/home/mark/src/elfutils/tests/hello.h" 99 file[3] = "/usr/include/stdlib.h" 100EOF 101 102testrun_compare ${abs_builddir}/get-files testfile-splitdwarf-5 testfile-hello5.dwo testfile-world5.dwo <<\EOF 103cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 53 104 dirs[0] = "/home/mark/src/elfutils/tests" 105 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" 106 file[0] = "/home/mark/src/elfutils/tests/hello.c" 107 file[1] = "/home/mark/src/elfutils/tests/hello.c" 108 file[2] = "/home/mark/src/elfutils/tests/hello.h" 109 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" 110cuhl = 20, o = 21, asz = 8, osz = 4, ncu = 106 111 dirs[0] = "/home/mark/src/elfutils/tests" 112 dirs[1] = "/usr/include" 113 file[0] = "/home/mark/src/elfutils/tests/world.c" 114 file[1] = "/home/mark/src/elfutils/tests/world.c" 115 file[2] = "/home/mark/src/elfutils/tests/hello.h" 116 file[3] = "/usr/include/stdlib.h" 117cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 386 118 dirs[0] = "/home/mark/src/elfutils/tests" 119 dirs[1] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include" 120 file[0] = "/home/mark/src/elfutils/tests/hello.c" 121 file[1] = "/home/mark/src/elfutils/tests/hello.c" 122 file[2] = "/home/mark/src/elfutils/tests/hello.h" 123 file[3] = "/opt/local/install/gcc/lib/gcc/x86_64-pc-linux-gnu/9.0.0/include/stddef.h" 124cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 296 125 dirs[0] = "/home/mark/src/elfutils/tests" 126 dirs[1] = "/usr/include" 127 file[0] = "/home/mark/src/elfutils/tests/world.c" 128 file[1] = "/home/mark/src/elfutils/tests/world.c" 129 file[2] = "/home/mark/src/elfutils/tests/hello.h" 130 file[3] = "/usr/include/stdlib.h" 131EOF 132 133# See testfile-dwp.source. 134testfiles testfile-dwp-5 testfile-dwp-5.dwp 135testfiles testfile-dwp-4 testfile-dwp-4.dwp 136 137testrun_compare ${abs_builddir}/get-files testfile-dwp-5 << EOF 138cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 53 139 dirs[0] = "/home/osandov/src/elfutils/tests" 140 dirs[1] = "/usr/include" 141 file[0] = "/home/osandov/src/elfutils/tests/foo.cc" 142 file[1] = "/home/osandov/src/elfutils/tests/foo.cc" 143 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 144 file[3] = "/usr/include/stdc-predef.h" 145cuhl = 20, o = 21, asz = 8, osz = 4, ncu = 106 146 dirs[0] = "/home/osandov/src/elfutils/tests" 147 dirs[1] = "/usr/include" 148 file[0] = "/home/osandov/src/elfutils/tests/bar.cc" 149 file[1] = "/home/osandov/src/elfutils/tests/bar.cc" 150 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 151 file[3] = "/usr/include/stdc-predef.h" 152cuhl = 20, o = 42, asz = 8, osz = 4, ncu = 155 153 dirs[0] = "/home/osandov/src/elfutils/tests" 154 dirs[1] = "/usr/include" 155 file[0] = "/home/osandov/src/elfutils/tests/main.cc" 156 file[1] = "/home/osandov/src/elfutils/tests/main.cc" 157 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 158 file[3] = "/usr/include/stdc-predef.h" 159EOF 160 161# Note that this one includes the type units in .debug_info.dwo as expected. 162testrun_compare ${abs_builddir}/get-files testfile-dwp-5.dwp << EOF 163cuhl = 24, o = 0, asz = 8, osz = 4, ncu = 112 164 dirs[0] = "/home/osandov/src/elfutils/tests" 165 dirs[1] = "/usr/include" 166 file[0] = "/home/osandov/src/elfutils/tests/foo.cc" 167 file[1] = "/home/osandov/src/elfutils/tests/foo.cc" 168 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 169 file[3] = "/usr/include/stdc-predef.h" 170cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 376 171 dirs[0] = "/home/osandov/src/elfutils/tests" 172 dirs[1] = "/usr/include" 173 file[0] = "/home/osandov/src/elfutils/tests/foo.cc" 174 file[1] = "/home/osandov/src/elfutils/tests/foo.cc" 175 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 176 file[3] = "/usr/include/stdc-predef.h" 177cuhl = 24, o = 0, asz = 8, osz = 4, ncu = 486 178 dirs[0] = "/home/osandov/src/elfutils/tests" 179 dirs[1] = "/usr/include" 180 file[0] = "/home/osandov/src/elfutils/tests/bar.cc" 181 file[1] = "/home/osandov/src/elfutils/tests/bar.cc" 182 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 183 file[3] = "/usr/include/stdc-predef.h" 184cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 606 185 dirs[0] = "/home/osandov/src/elfutils/tests" 186 dirs[1] = "/usr/include" 187 file[0] = "/home/osandov/src/elfutils/tests/bar.cc" 188 file[1] = "/home/osandov/src/elfutils/tests/bar.cc" 189 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 190 file[3] = "/usr/include/stdc-predef.h" 191cuhl = 20, o = 0, asz = 8, osz = 4, ncu = 1009 192 dirs[0] = "/home/osandov/src/elfutils/tests" 193 dirs[1] = "/usr/include" 194 file[0] = "/home/osandov/src/elfutils/tests/main.cc" 195 file[1] = "/home/osandov/src/elfutils/tests/main.cc" 196 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 197 file[3] = "/usr/include/stdc-predef.h" 198EOF 199 200testrun_compare ${abs_builddir}/get-files testfile-dwp-4 << EOF 201cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 56 202 dirs[0] = "/home/osandov/src/elfutils/tests" 203 dirs[1] = "/usr/include" 204 file[0] = "???" 205 file[1] = "/home/osandov/src/elfutils/tests/foo.cc" 206 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 207 file[3] = "/usr/include/stdc-predef.h" 208cuhl = 11, o = 29, asz = 8, osz = 4, ncu = 108 209 dirs[0] = "/home/osandov/src/elfutils/tests" 210 dirs[1] = "/usr/include" 211 file[0] = "???" 212 file[1] = "/home/osandov/src/elfutils/tests/bar.cc" 213 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 214 file[3] = "/usr/include/stdc-predef.h" 215cuhl = 11, o = 55, asz = 8, osz = 4, ncu = 160 216 dirs[0] = "/home/osandov/src/elfutils/tests" 217 dirs[1] = "/usr/include" 218 file[0] = "???" 219 file[1] = "/home/osandov/src/elfutils/tests/main.cc" 220 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 221 file[3] = "/usr/include/stdc-predef.h" 222EOF 223 224testrun_compare ${abs_builddir}/get-files testfile-dwp-4.dwp << EOF 225cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 286 226 dirs[0] = "/home/osandov/src/elfutils/tests" 227 dirs[1] = "/usr/include" 228 file[0] = "???" 229 file[1] = "/home/osandov/src/elfutils/tests/foo.cc" 230 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 231 file[3] = "/usr/include/stdc-predef.h" 232cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 404 233 dirs[0] = "/home/osandov/src/elfutils/tests" 234 dirs[1] = "/usr/include" 235 file[0] = "???" 236 file[1] = "/home/osandov/src/elfutils/tests/bar.cc" 237 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 238 file[3] = "/usr/include/stdc-predef.h" 239cuhl = 11, o = 0, asz = 8, osz = 4, ncu = 857 240 dirs[0] = "/home/osandov/src/elfutils/tests" 241 dirs[1] = "/usr/include" 242 file[0] = "???" 243 file[1] = "/home/osandov/src/elfutils/tests/main.cc" 244 file[2] = "/home/osandov/src/elfutils/tests/foobar.h" 245 file[3] = "/usr/include/stdc-predef.h" 246EOF 247 248exit 0 249