Copyright update for binutils
[external/binutils.git] / gas / testsuite / gas / symver / symver.exp
1 # Copyright (C) 2012-2016 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     # not yet supported by i960
50     if {[istarget "i960-*-*"]} {
51       return
52     }
53
54     run_dump_test "symver0" 
55     run_dump_test "symver1" 
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 "symver6" ""
65 }