]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gas/testsuite/gas/cfi/cfi.exp
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / gas / testsuite / gas / cfi / cfi.exp
CommitLineData
fd67aa11 1# Copyright (C) 2012-2024 Free Software Foundation, Inc.
5bf135a7
NC
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
3251495b 17if { ![is_elf_format] && ![is_pecoff_format] } then {
d04428bd
AM
18 return
19}
fa87b337 20
b6460688
L
21proc gas_x86_64_check { } {
22 global NM
23 global NMFLAGS
2ebaa23b 24
b6460688
L
25 set status [gas_host_run "$NM $NMFLAGS --help" ""]
26 return [regexp "targets:.*x86-64" [lindex $status 1]];
27}
28
29proc gas_x86_32_check { } {
30 global NM
31 global NMFLAGS
32
33 set status [gas_host_run "$NM $NMFLAGS --help" ""]
34 return [regexp "targets:.*i386" [lindex $status 1]];
35}
36
37if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then {
38
39 global ASFLAGS
40 set old_ASFLAGS "$ASFLAGS"
41
42 if { [gas_x86_64_check] } then {
43 set ASFLAGS "$ASFLAGS --64"
44 run_dump_test "cfi-x86_64"
45 set ASFLAGS "$old_ASFLAGS"
46 }
47
48 if { [gas_x86_32_check] } then {
49 set ASFLAGS "$ASFLAGS --32"
50 run_dump_test "cfi-i386"
1ab84e02 51 run_dump_test "cfi-i386-2"
b6460688
L
52 set ASFLAGS "$old_ASFLAGS"
53 }
f37f01cf 54
69602580
JB
55 if { [is_elf_format] } then {
56 run_dump_test "cfi-label"
57 }
58
3251495b
RH
59 if { [is_pecoff_format] } then {
60 run_dump_test "reloc-pe-i386"
61 }
62
d04428bd
AM
63} elseif { [istarget alpha*-*-*] } then {
64 run_dump_test "cfi-alpha-1"
65 run_dump_test "cfi-alpha-2"
66 run_dump_test "cfi-alpha-3"
f37f01cf 67
3ee6e4fb
NC
68} elseif { [istarget "arc*-*-*"] } then {
69 run_dump_test "cfi-arc-1"
70
71} elseif { [istarget "arm*-*"] } then {
72 # Only ELF based ARM targets support CFI.
73 if { [is_pecoff_format] } then {
74 return
75 }
76 run_dump_test "cfi-arm-1"
77
78} elseif { [istarget "hppa*-linux*"] } then {
79 run_dump_test "cfi-hppa-1"
80
81} elseif { [istarget "m68*-*"] && ![istarget "m68hc1*-*"] } then {
82 run_dump_test "cfi-m68k"
83
84} elseif { [istarget "mips*-*"] } then {
85 run_dump_test "cfi-mips-1"
86
ab1f5dd1 87} elseif { [istarget powerpc*-*-*] } then {
75e21f08
JJ
88 run_dump_test "cfi-ppc-1"
89
90} elseif { [istarget s390*-*-*] } then {
91 run_dump_test "cfi-s390-1"
92 if { [istarget s390x*-*-*] } then {
93 run_dump_test "cfi-s390x-1"
94 }
95
3ee6e4fb 96} elseif [istarget "sh*-*"] then {
3002e78a 97 if { [istarget "*-pe" ] } then {
3ee6e4fb
NC
98 return
99 }
211dc24b 100 run_dump_test "cfi-sh-1"
c04898f8 101
364b6d8b
JJ
102} elseif { [istarget sparc*-*-*] } then {
103 global NM
104 global NMFLAGS
364b6d8b 105
7f6a71ff 106 set nm_status [gas_host_run "$NM $NMFLAGS --help" ""]
364b6d8b 107 run_dump_test "cfi-sparc-1"
7f6a71ff 108 if { [regexp "elf64\[_-\]sparc" [lindex $nm_status 1]] } then {
364b6d8b
JJ
109 run_dump_test "cfi-sparc64-1"
110 }
2ce4cc60 111
d04428bd
AM
112} else {
113 return
f37f01cf 114}
fa87b337 115
d04428bd 116run_list_test "cfi-diag-1" ""
f3a503f6 117
aa8d5e45
RH
118# HPPA64 uses 64-bit relocations, which results in all of the dump
119# offset numbers not matching up.
120if { ![istarget "hppa64*-*"] } then {
121 run_dump_test "cfi-common-1"
122 run_dump_test "cfi-common-2"
123 run_dump_test "cfi-common-3"
124 run_dump_test "cfi-common-4"
3251495b
RH
125 if { ![is_pecoff_format] } then {
126 # This test uses .subsection/.previous which are elf-specific.
127 run_dump_test "cfi-common-5"
128 }
ab1f5dd1 129 # Some targets don't support PC relative cfi directives
fe49679d 130 if { ![istarget "mips*-*"] } then {
f3a503f6 131 run_dump_test "cfi-common-6"
40a41a9a
DA
132 }
133 run_dump_test "cfi-common-7"
084303b8 134 run_dump_test "cfi-common-8"
3d3424e9 135 run_dump_test "cfi-common-9"
66f8b2cb
AB
136
137 run_dump_test "cie-version-0"
138 run_dump_test "cie-version-1"
139 run_dump_test "cie-version-2"
140 run_dump_test "cie-version-3"
141 run_dump_test "cie-version-4"
f3a503f6 142}