2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
18 if { ![is_elf_format] && ![is_pecoff_format] } then {
22 proc gas_x86_64_check { } {
26 set status [gas_host_run "$NM $NMFLAGS --help" ""]
27 return [regexp "targets:.*x86-64" [lindex $status 1]];
30 proc gas_x86_32_check { } {
34 set status [gas_host_run "$NM $NMFLAGS --help" ""]
35 return [regexp "targets:.*i386" [lindex $status 1]];
38 if { [istarget "i*86-*-*"] || [istarget "x86_64-*-*"] } then {
41 set old_ASFLAGS "$ASFLAGS"
43 if { [gas_x86_64_check] } then {
44 set ASFLAGS "$ASFLAGS --64"
45 run_dump_test "cfi-x86_64"
46 set ASFLAGS "$old_ASFLAGS"
49 if { [gas_x86_32_check] } then {
50 set ASFLAGS "$ASFLAGS --32"
51 run_dump_test "cfi-i386"
52 set ASFLAGS "$old_ASFLAGS"
55 if { [is_pecoff_format] } then {
56 run_dump_test "reloc-pe-i386"
59 } elseif { [istarget alpha*-*-*] } then {
60 run_dump_test "cfi-alpha-1"
61 run_dump_test "cfi-alpha-2"
62 run_dump_test "cfi-alpha-3"
64 } elseif { [istarget powerpc*-*-*] } then {
65 run_dump_test "cfi-ppc-1"
67 } elseif { [istarget s390*-*-*] } then {
68 run_dump_test "cfi-s390-1"
69 if { [istarget s390x*-*-*] } then {
70 run_dump_test "cfi-s390x-1"
73 } elseif { [istarget "m68*-*"] } then {
74 run_dump_test "cfi-m68k"
76 } elseif { [istarget sparc*-*-*] } then {
80 set nm_status [gas_host_run "$NM $NMFLAGS --help" ""]
81 run_dump_test "cfi-sparc-1"
82 if { [regexp "elf64\[_-\]sparc" [lindex $nm_status 1]] } then {
83 run_dump_test "cfi-sparc64-1"
86 } elseif [istarget "sh*-*"] then {
87 if { [istarget sh64*-*-*] || [istarget sh5*-*-*] } then {
89 run_dump_test "cfi-sh-1"
92 } elseif { [istarget "arm*-*"] } then {
93 # Only ELF based ARM targets support CFI.
94 if { [is_pecoff_format] } then {
97 run_dump_test "cfi-arm-1"
99 } elseif { [istarget "mips*-*"] } then {
100 run_dump_test "cfi-mips-1"
101 } elseif { [istarget "hppa*-linux*"] } then {
102 run_dump_test "cfi-hppa-1"
107 run_list_test "cfi-diag-1" ""
109 # HPPA64 uses 64-bit relocations, which results in all of the dump
110 # offset numbers not matching up.
111 if { ![istarget "hppa64*-*"] } then {
112 run_dump_test "cfi-common-1"
113 run_dump_test "cfi-common-2"
114 run_dump_test "cfi-common-3"
115 run_dump_test "cfi-common-4"
116 if { ![is_pecoff_format] } then {
117 # This test uses .subsection/.previous which are elf-specific.
118 run_dump_test "cfi-common-5"
120 # Some targets don't support PC relative cfi directives
121 if { ![istarget "mips*-*"] &&
122 !([istarget powerpc*-*-*] && [is_pecoff_format]) } then {
123 run_dump_test "cfi-common-6"
125 run_dump_test "cfi-common-7"