]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gas/testsuite/gas/symver/symver.exp
abb7beb445f833639e1301da6b93b003f0f0c54e
[thirdparty/binutils-gdb.git] / gas / testsuite / gas / symver / symver.exp
1 # Copyright (C) 2012-2022 Free Software Foundation, Inc.
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
16
17 #
18 # symver tests
19 #
20 proc run_error_test { name opts } {
21 global srcdir subdir
22 set testname "symver $name"
23 set file $srcdir/$subdir/$name
24 gas_run ${name}.s $opts ">&dump.out"
25 if { [regexp_diff "dump.out" "${file}.l"] } then {
26 fail $testname
27 verbose "output is [file_contents "dump.out"]" 2
28 return
29 }
30 pass $testname
31 }
32
33 # symver is only supported by ELF targets.
34 if { [is_elf_format] } then {
35
36 if {[istarget "ia64-*"]} then {
37 return
38 }
39
40 if {[istarget "hppa*64*-*-*"]} then {
41 return
42 }
43
44 # not supported by D30V
45 if {[istarget "d30v-*-*"]} {
46 return
47 }
48
49 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
50 foreach t $test_list {
51 # We need to strip the ".d", but can leave the dirname.
52 verbose [file rootname $t]
53 run_dump_test [file rootname $t]
54 }
55
56 run_error_test "symver2" ""
57 run_error_test "symver3" ""
58 # We have to comment out symver4 and symver5, which check the
59 # missing version name, since some tests in ld/testsuite/ld-elfvers
60 # have no version names. We cannot flag an error for the missing
61 # version name.
62 # run_error_test "symver4" ""
63 # run_error_test "symver5" ""
64 run_error_test "symver14" ""
65 run_error_test "symver15" ""
66 }